| OLD | NEW |
| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 | 307 |
| 308 #ifdef DEBUG | 308 #ifdef DEBUG |
| 309 bool Context::IsBootstrappingOrValidParentContext( | 309 bool Context::IsBootstrappingOrValidParentContext( |
| 310 Object* object, Context* child) { | 310 Object* object, Context* child) { |
| 311 // During bootstrapping we allow all objects to pass as | 311 // During bootstrapping we allow all objects to pass as |
| 312 // contexts. This is necessary to fix circular dependencies. | 312 // contexts. This is necessary to fix circular dependencies. |
| 313 if (Isolate::Current()->bootstrapper()->IsActive()) return true; | 313 if (Isolate::Current()->bootstrapper()->IsActive()) return true; |
| 314 if (!object->IsContext()) return false; | 314 if (!object->IsContext()) return false; |
| 315 Context* context = Context::cast(object); | 315 Context* context = Context::cast(object); |
| 316 return context->IsNativeContext() || context->IsModuleContext() || | 316 return context->IsNativeContext() || context->IsGlobalContext() || |
| 317 !child->IsModuleContext(); | 317 context->IsModuleContext() || !child->IsModuleContext(); |
| 318 } | 318 } |
| 319 | 319 |
| 320 | 320 |
| 321 bool Context::IsBootstrappingOrGlobalObject(Object* object) { | 321 bool Context::IsBootstrappingOrGlobalObject(Object* object) { |
| 322 // During bootstrapping we allow all objects to pass as global | 322 // During bootstrapping we allow all objects to pass as global |
| 323 // objects. This is necessary to fix circular dependencies. | 323 // objects. This is necessary to fix circular dependencies. |
| 324 Isolate* isolate = Isolate::Current(); | 324 Isolate* isolate = Isolate::Current(); |
| 325 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 325 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 326 isolate->bootstrapper()->IsActive() || | 326 isolate->bootstrapper()->IsActive() || |
| 327 object->IsGlobalObject(); | 327 object->IsGlobalObject(); |
| 328 } | 328 } |
| 329 #endif | 329 #endif |
| 330 | 330 |
| 331 } } // namespace v8::internal | 331 } } // namespace v8::internal |
| OLD | NEW |