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