| 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.h" | 8 #include "src/heap.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 native_object_get_notifier) \ | 182 native_object_get_notifier) \ |
| 183 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ | 183 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ |
| 184 native_object_notifier_perform_change) \ | 184 native_object_notifier_perform_change) \ |
| 185 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ | 185 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ |
| 186 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ | 186 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ |
| 187 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, \ | 187 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, \ |
| 188 generator_object_prototype_map) \ | 188 generator_object_prototype_map) \ |
| 189 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ | 189 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ |
| 190 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ | 190 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ |
| 191 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ | 191 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ |
| 192 V(ITERATOR_SYMBOL_INDEX, Symbol, iterator_symbol) | 192 V(ITERATOR_SYMBOL_INDEX, Symbol, iterator_symbol) \ |
| 193 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) |
| 193 | 194 |
| 194 // JSFunctions are pairs (context, function code), sometimes also called | 195 // JSFunctions are pairs (context, function code), sometimes also called |
| 195 // closures. A Context object is used to represent function contexts and | 196 // closures. A Context object is used to represent function contexts and |
| 196 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 197 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
| 197 // | 198 // |
| 198 // At runtime, the contexts build a stack in parallel to the execution | 199 // At runtime, the contexts build a stack in parallel to the execution |
| 199 // stack, with the top-most context being the current context. All contexts | 200 // stack, with the top-most context being the current context. All contexts |
| 200 // have the following slots: | 201 // have the following slots: |
| 201 // | 202 // |
| 202 // [ closure ] This is the current function. It is the same for all | 203 // [ closure ] This is the current function. It is the same for all |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 NATIVE_OBJECT_OBSERVE_INDEX, | 358 NATIVE_OBJECT_OBSERVE_INDEX, |
| 358 NATIVE_OBJECT_GET_NOTIFIER_INDEX, | 359 NATIVE_OBJECT_GET_NOTIFIER_INDEX, |
| 359 NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, | 360 NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, |
| 360 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, | 361 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, |
| 361 STRICT_GENERATOR_FUNCTION_MAP_INDEX, | 362 STRICT_GENERATOR_FUNCTION_MAP_INDEX, |
| 362 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, | 363 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, |
| 363 ITERATOR_RESULT_MAP_INDEX, | 364 ITERATOR_RESULT_MAP_INDEX, |
| 364 MAP_ITERATOR_MAP_INDEX, | 365 MAP_ITERATOR_MAP_INDEX, |
| 365 SET_ITERATOR_MAP_INDEX, | 366 SET_ITERATOR_MAP_INDEX, |
| 366 ITERATOR_SYMBOL_INDEX, | 367 ITERATOR_SYMBOL_INDEX, |
| 368 ARRAY_VALUES_ITERATOR_INDEX, |
| 367 | 369 |
| 368 // Properties from here are treated as weak references by the full GC. | 370 // Properties from here are treated as weak references by the full GC. |
| 369 // Scavenge treats them as strong references. | 371 // Scavenge treats them as strong references. |
| 370 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 372 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
| 371 OPTIMIZED_CODE_LIST, // Weak. | 373 OPTIMIZED_CODE_LIST, // Weak. |
| 372 DEOPTIMIZED_CODE_LIST, // Weak. | 374 DEOPTIMIZED_CODE_LIST, // Weak. |
| 373 MAP_CACHE_INDEX, // Weak. | 375 MAP_CACHE_INDEX, // Weak. |
| 374 NEXT_CONTEXT_LINK, // Weak. | 376 NEXT_CONTEXT_LINK, // Weak. |
| 375 | 377 |
| 376 // Total number of slots. | 378 // Total number of slots. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 553 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 552 #endif | 554 #endif |
| 553 | 555 |
| 554 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 556 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 555 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 557 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 556 }; | 558 }; |
| 557 | 559 |
| 558 } } // namespace v8::internal | 560 } } // namespace v8::internal |
| 559 | 561 |
| 560 #endif // V8_CONTEXTS_H_ | 562 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |