Chromium Code Reviews| 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, |
| 17 FOLLOW_PROTOTYPE_CHAIN = 2, | 17 FOLLOW_PROTOTYPE_CHAIN = 2, |
| 18 STOP_AT_DECLARATION_SCOPE = 4, | |
| 19 SKIP_WITH_CONTEXT = 8, | |
|
adamk
2015/10/05 17:20:36
Can you change these to "1 << N" form now that we'
Dan Ehrenberg
2015/10/08 23:01:26
Done
| |
| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 #endif | 551 #endif |
| 548 | 552 |
| 549 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 553 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 550 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 554 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 551 }; | 555 }; |
| 552 | 556 |
| 553 } // namespace internal | 557 } // namespace internal |
| 554 } // namespace v8 | 558 } // namespace v8 |
| 555 | 559 |
| 556 #endif // V8_CONTEXTS_H_ | 560 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |