Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: src/contexts.cc

Issue 10690043: Implement proper module linking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index 76784bd704602b955924c6255c8883b013b1e624..7c610aff674ed3e9cb73122b77209a75ddb99fe8 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -304,10 +304,14 @@ void Context::ClearOptimizedFunctions() {
#ifdef DEBUG
-bool Context::IsBootstrappingOrContext(Object* object) {
+bool Context::IsBootstrappingOrValidContext(Object* object) {
// During bootstrapping we allow all objects to pass as
// contexts. This is necessary to fix circular dependencies.
- return Isolate::Current()->bootstrapper()->IsActive() || object->IsContext();
+ if (Isolate::Current()->bootstrapper()->IsActive()) return true;
+ if (!object->IsContext()) return false;
+ Context* context = Context::cast(object);
+ return context->IsGlobalContext() || context->IsModuleContext() ||
+ !this->IsModuleContext();
}

Powered by Google App Engine
This is Rietveld 408576698