OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_CONTEXTS_H_ | 5 #ifndef V8_CONTEXTS_H_ |
6 #define V8_CONTEXTS_H_ | 6 #define V8_CONTEXTS_H_ |
7 | 7 |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 | 14 |
15 enum ContextLookupFlags { | 15 enum ContextLookupFlags { |
16 FOLLOW_CONTEXT_CHAIN = 1, | 16 FOLLOW_CONTEXT_CHAIN = 1 << 0, |
17 FOLLOW_PROTOTYPE_CHAIN = 2, | 17 FOLLOW_PROTOTYPE_CHAIN = 1 << 1, |
| 18 STOP_AT_DECLARATION_SCOPE = 1 << 2, |
| 19 SKIP_WITH_CONTEXT = 1 << 3, |
18 | 20 |
19 DONT_FOLLOW_CHAINS = 0, | 21 DONT_FOLLOW_CHAINS = 0, |
20 FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN | 22 FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN, |
| 23 LEXICAL_TEST = |
| 24 FOLLOW_CONTEXT_CHAIN | STOP_AT_DECLARATION_SCOPE | SKIP_WITH_CONTEXT, |
21 }; | 25 }; |
22 | 26 |
23 | 27 |
24 // ES5 10.2 defines lexical environments with mutable and immutable bindings. | 28 // ES5 10.2 defines lexical environments with mutable and immutable bindings. |
25 // Immutable bindings have two states, initialized and uninitialized, and | 29 // Immutable bindings have two states, initialized and uninitialized, and |
26 // their state is changed by the InitializeImmutableBinding method. The | 30 // their state is changed by the InitializeImmutableBinding method. The |
27 // BindingFlags enum represents information if a binding has definitely been | 31 // BindingFlags enum represents information if a binding has definitely been |
28 // initialized. A mutable binding does not need to be checked and thus has | 32 // initialized. A mutable binding does not need to be checked and thus has |
29 // the BindingFlag MUTABLE_IS_INITIALIZED. | 33 // the BindingFlag MUTABLE_IS_INITIALIZED. |
30 // | 34 // |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 555 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
552 #endif | 556 #endif |
553 | 557 |
554 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 558 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
555 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 559 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
556 }; | 560 }; |
557 | 561 |
558 } } // namespace v8::internal | 562 } } // namespace v8::internal |
559 | 563 |
560 #endif // V8_CONTEXTS_H_ | 564 #endif // V8_CONTEXTS_H_ |
OLD | NEW |