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

Side by Side 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, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return get(OPTIMIZED_FUNCTIONS_LIST); 297 return get(OPTIMIZED_FUNCTIONS_LIST);
298 } 298 }
299 299
300 300
301 void Context::ClearOptimizedFunctions() { 301 void Context::ClearOptimizedFunctions() {
302 set(OPTIMIZED_FUNCTIONS_LIST, GetHeap()->undefined_value()); 302 set(OPTIMIZED_FUNCTIONS_LIST, GetHeap()->undefined_value());
303 } 303 }
304 304
305 305
306 #ifdef DEBUG 306 #ifdef DEBUG
307 bool Context::IsBootstrappingOrContext(Object* object) { 307 bool Context::IsBootstrappingOrValidContext(Object* object) {
308 // During bootstrapping we allow all objects to pass as 308 // During bootstrapping we allow all objects to pass as
309 // contexts. This is necessary to fix circular dependencies. 309 // contexts. This is necessary to fix circular dependencies.
310 return Isolate::Current()->bootstrapper()->IsActive() || object->IsContext(); 310 if (Isolate::Current()->bootstrapper()->IsActive()) return true;
311 if (!object->IsContext()) return false;
312 Context* context = Context::cast(object);
313 return context->IsGlobalContext() || context->IsModuleContext() ||
314 !this->IsModuleContext();
311 } 315 }
312 316
313 317
314 bool Context::IsBootstrappingOrGlobalObject(Object* object) { 318 bool Context::IsBootstrappingOrGlobalObject(Object* object) {
315 // During bootstrapping we allow all objects to pass as global 319 // During bootstrapping we allow all objects to pass as global
316 // objects. This is necessary to fix circular dependencies. 320 // objects. This is necessary to fix circular dependencies.
317 Isolate* isolate = Isolate::Current(); 321 Isolate* isolate = Isolate::Current();
318 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 322 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
319 isolate->bootstrapper()->IsActive() || 323 isolate->bootstrapper()->IsActive() ||
320 object->IsGlobalObject(); 324 object->IsGlobalObject();
321 } 325 }
322 #endif 326 #endif
323 327
324 } } // namespace v8::internal 328 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698