=== From yukishiino@ ===
The mapping from blink::ExecutionContext to v8::Isolate is N:1 mapping, and the mappings are static (not dynamically changing). So, it's a good idea to have ExecutionContext remember its associated v8::Isolate. We only have a historical reason about why we're not currently doing so. The fundamental idea is demonstrated as below:
class ExecutionContext {
ExecutionContext(v8::Isolate* isolate)
: isolate_(isolate) {}
v8::Isolate* GetV8Isolate() const { return isolate_; }
v8::Isolate* const isolate_ = nullptr;
};
Currently we're using ToIsolate(ExecutionContext*) to convert an ExecutionContext to a v8::Isolate, however, this implementation depends on several assumptions and we're not sure whether this function is always working as expected (I think the answer is No). The way illustrated above is much simpler and always reliable.
===
Comment 1 Deleted