| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
| 8 #include "debug.h" | 8 #include "debug.h" |
| 9 #include "scopeinfo.h" | 9 #include "scopeinfo.h" |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (context->IsNativeContext() || | 101 if (context->IsNativeContext() || |
| 102 context->IsWithContext() || | 102 context->IsWithContext() || |
| 103 (context->IsFunctionContext() && context->has_extension())) { | 103 (context->IsFunctionContext() && context->has_extension())) { |
| 104 Handle<JSReceiver> object( | 104 Handle<JSReceiver> object( |
| 105 JSReceiver::cast(context->extension()), isolate); | 105 JSReceiver::cast(context->extension()), isolate); |
| 106 // Context extension objects needs to behave as if they have no | 106 // Context extension objects needs to behave as if they have no |
| 107 // prototype. So even if we want to follow prototype chains, we need | 107 // prototype. So even if we want to follow prototype chains, we need |
| 108 // to only do a local lookup for context extension objects. | 108 // to only do a local lookup for context extension objects. |
| 109 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || | 109 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || |
| 110 object->IsJSContextExtensionObject()) { | 110 object->IsJSContextExtensionObject()) { |
| 111 *attributes = JSReceiver::GetLocalPropertyAttribute(object, name); | 111 *attributes = JSReceiver::GetOwnPropertyAttribute(object, name); |
| 112 } else { | 112 } else { |
| 113 *attributes = JSReceiver::GetPropertyAttribute(object, name); | 113 *attributes = JSReceiver::GetPropertyAttribute(object, name); |
| 114 } | 114 } |
| 115 if (isolate->has_pending_exception()) return Handle<Object>(); | 115 if (isolate->has_pending_exception()) return Handle<Object>(); |
| 116 | 116 |
| 117 if (*attributes != ABSENT) { | 117 if (*attributes != ABSENT) { |
| 118 if (FLAG_trace_contexts) { | 118 if (FLAG_trace_contexts) { |
| 119 PrintF("=> found property in context object %p\n", | 119 PrintF("=> found property in context object %p\n", |
| 120 reinterpret_cast<void*>(*object)); | 120 reinterpret_cast<void*>(*object)); |
| 121 } | 121 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 367 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
| 368 // During bootstrapping we allow all objects to pass as global | 368 // During bootstrapping we allow all objects to pass as global |
| 369 // objects. This is necessary to fix circular dependencies. | 369 // objects. This is necessary to fix circular dependencies. |
| 370 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 370 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 371 isolate->bootstrapper()->IsActive() || | 371 isolate->bootstrapper()->IsActive() || |
| 372 object->IsGlobalObject(); | 372 object->IsGlobalObject(); |
| 373 } | 373 } |
| 374 #endif | 374 #endif |
| 375 | 375 |
| 376 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| OLD | NEW |