OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/debug.h" | 8 #include "src/debug.h" |
9 #include "src/scopeinfo.h" | 9 #include "src/scopeinfo.h" |
10 | 10 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 if (FLAG_trace_contexts) { | 272 if (FLAG_trace_contexts) { |
273 PrintF("=> found property in context object %p\n", | 273 PrintF("=> found property in context object %p\n", |
274 reinterpret_cast<void*>(*object)); | 274 reinterpret_cast<void*>(*object)); |
275 } | 275 } |
276 return object; | 276 return object; |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 // 2. Check the context proper if it has slots. | 280 // 2. Check the context proper if it has slots. |
281 if (context->IsFunctionContext() || context->IsBlockContext() || | 281 if (context->IsFunctionContext() || context->IsBlockContext() || |
282 (FLAG_harmony_scoping && context->IsScriptContext())) { | 282 context->IsScriptContext()) { |
283 // Use serialized scope information of functions and blocks to search | 283 // Use serialized scope information of functions and blocks to search |
284 // for the context index. | 284 // for the context index. |
285 Handle<ScopeInfo> scope_info; | 285 Handle<ScopeInfo> scope_info; |
286 if (context->IsFunctionContext()) { | 286 if (context->IsFunctionContext()) { |
287 scope_info = Handle<ScopeInfo>( | 287 scope_info = Handle<ScopeInfo>( |
288 context->closure()->shared()->scope_info(), isolate); | 288 context->closure()->shared()->scope_info(), isolate); |
289 } else { | 289 } else { |
290 scope_info = Handle<ScopeInfo>( | 290 scope_info = Handle<ScopeInfo>( |
291 ScopeInfo::cast(context->extension()), isolate); | 291 ScopeInfo::cast(context->extension()), isolate); |
292 } | 292 } |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 488 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
489 // During bootstrapping we allow all objects to pass as global | 489 // During bootstrapping we allow all objects to pass as global |
490 // objects. This is necessary to fix circular dependencies. | 490 // objects. This is necessary to fix circular dependencies. |
491 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 491 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
492 isolate->bootstrapper()->IsActive() || | 492 isolate->bootstrapper()->IsActive() || |
493 object->IsGlobalObject(); | 493 object->IsGlobalObject(); |
494 } | 494 } |
495 #endif | 495 #endif |
496 | 496 |
497 } } // namespace v8::internal | 497 } } // namespace v8::internal |
OLD | NEW |