| 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 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \ | 194 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \ |
| 195 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ | 195 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ |
| 196 native_object_notifier_perform_change) \ | 196 native_object_notifier_perform_change) \ |
| 197 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ | 197 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ |
| 198 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ | 198 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ |
| 199 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \ | 199 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \ |
| 200 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ | 200 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ |
| 201 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ | 201 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ |
| 202 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ | 202 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ |
| 203 V(ITERATOR_SYMBOL_INDEX, Symbol, iterator_symbol) \ | 203 V(ITERATOR_SYMBOL_INDEX, Symbol, iterator_symbol) \ |
| 204 V(UNSCOPABLES_SYMBOL_INDEX, Symbol, unscopables_symbol) | 204 V(UNSCOPABLES_SYMBOL_INDEX, Symbol, unscopables_symbol) \ |
| 205 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) |
| 205 | 206 |
| 206 // JSFunctions are pairs (context, function code), sometimes also called | 207 // JSFunctions are pairs (context, function code), sometimes also called |
| 207 // closures. A Context object is used to represent function contexts and | 208 // closures. A Context object is used to represent function contexts and |
| 208 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). | 209 // dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak). |
| 209 // | 210 // |
| 210 // At runtime, the contexts build a stack in parallel to the execution | 211 // At runtime, the contexts build a stack in parallel to the execution |
| 211 // stack, with the top-most context being the current context. All contexts | 212 // stack, with the top-most context being the current context. All contexts |
| 212 // have the following slots: | 213 // have the following slots: |
| 213 // | 214 // |
| 214 // [ closure ] This is the current function. It is the same for all | 215 // [ closure ] This is the current function. It is the same for all |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 NATIVE_OBJECT_GET_NOTIFIER_INDEX, | 390 NATIVE_OBJECT_GET_NOTIFIER_INDEX, |
| 390 NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, | 391 NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, |
| 391 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, | 392 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, |
| 392 STRICT_GENERATOR_FUNCTION_MAP_INDEX, | 393 STRICT_GENERATOR_FUNCTION_MAP_INDEX, |
| 393 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, | 394 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, |
| 394 ITERATOR_RESULT_MAP_INDEX, | 395 ITERATOR_RESULT_MAP_INDEX, |
| 395 MAP_ITERATOR_MAP_INDEX, | 396 MAP_ITERATOR_MAP_INDEX, |
| 396 SET_ITERATOR_MAP_INDEX, | 397 SET_ITERATOR_MAP_INDEX, |
| 397 ITERATOR_SYMBOL_INDEX, | 398 ITERATOR_SYMBOL_INDEX, |
| 398 UNSCOPABLES_SYMBOL_INDEX, | 399 UNSCOPABLES_SYMBOL_INDEX, |
| 400 ARRAY_VALUES_ITERATOR_INDEX, |
| 399 | 401 |
| 400 // Properties from here are treated as weak references by the full GC. | 402 // Properties from here are treated as weak references by the full GC. |
| 401 // Scavenge treats them as strong references. | 403 // Scavenge treats them as strong references. |
| 402 OPTIMIZED_FUNCTIONS_LIST, // Weak. | 404 OPTIMIZED_FUNCTIONS_LIST, // Weak. |
| 403 OPTIMIZED_CODE_LIST, // Weak. | 405 OPTIMIZED_CODE_LIST, // Weak. |
| 404 DEOPTIMIZED_CODE_LIST, // Weak. | 406 DEOPTIMIZED_CODE_LIST, // Weak. |
| 405 MAP_CACHE_INDEX, // Weak. | 407 MAP_CACHE_INDEX, // Weak. |
| 406 NEXT_CONTEXT_LINK, // Weak. | 408 NEXT_CONTEXT_LINK, // Weak. |
| 407 | 409 |
| 408 // Total number of slots. | 410 // Total number of slots. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 584 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 583 #endif | 585 #endif |
| 584 | 586 |
| 585 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 587 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 586 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 588 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 587 }; | 589 }; |
| 588 | 590 |
| 589 } } // namespace v8::internal | 591 } } // namespace v8::internal |
| 590 | 592 |
| 591 #endif // V8_CONTEXTS_H_ | 593 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |