| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 (context->IsFunctionContext() && context->has_extension())) { | 135 (context->IsFunctionContext() && context->has_extension())) { |
| 136 Handle<JSReceiver> object( | 136 Handle<JSReceiver> object( |
| 137 JSReceiver::cast(context->extension()), isolate); | 137 JSReceiver::cast(context->extension()), isolate); |
| 138 // Context extension objects needs to behave as if they have no | 138 // Context extension objects needs to behave as if they have no |
| 139 // prototype. So even if we want to follow prototype chains, we need | 139 // prototype. So even if we want to follow prototype chains, we need |
| 140 // to only do a local lookup for context extension objects. | 140 // to only do a local lookup for context extension objects. |
| 141 Maybe<PropertyAttributes> maybe; | 141 Maybe<PropertyAttributes> maybe; |
| 142 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || | 142 if ((flags & FOLLOW_PROTOTYPE_CHAIN) == 0 || |
| 143 object->IsJSContextExtensionObject()) { | 143 object->IsJSContextExtensionObject()) { |
| 144 maybe = JSReceiver::GetOwnPropertyAttributes(object, name); | 144 maybe = JSReceiver::GetOwnPropertyAttributes(object, name); |
| 145 } else if (FLAG_harmony_unscopables && context->IsWithContext()) { | 145 } else if (context->IsWithContext()) { |
| 146 LookupIterator it(object, name); | 146 LookupIterator it(object, name); |
| 147 maybe = UnscopableLookup(&it); | 147 maybe = UnscopableLookup(&it); |
| 148 } else { | 148 } else { |
| 149 maybe = JSReceiver::GetPropertyAttributes(object, name); | 149 maybe = JSReceiver::GetPropertyAttributes(object, name); |
| 150 } | 150 } |
| 151 | 151 |
| 152 if (!maybe.has_value) return Handle<Object>(); | 152 if (!maybe.has_value) return Handle<Object>(); |
| 153 DCHECK(!isolate->has_pending_exception()); | 153 DCHECK(!isolate->has_pending_exception()); |
| 154 *attributes = maybe.value; | 154 *attributes = maybe.value; |
| 155 | 155 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { | 409 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { |
| 410 // During bootstrapping we allow all objects to pass as global | 410 // During bootstrapping we allow all objects to pass as global |
| 411 // objects. This is necessary to fix circular dependencies. | 411 // objects. This is necessary to fix circular dependencies. |
| 412 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 412 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 413 isolate->bootstrapper()->IsActive() || | 413 isolate->bootstrapper()->IsActive() || |
| 414 object->IsGlobalObject(); | 414 object->IsGlobalObject(); |
| 415 } | 415 } |
| 416 #endif | 416 #endif |
| 417 | 417 |
| 418 } } // namespace v8::internal | 418 } } // namespace v8::internal |
| OLD | NEW |