Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/contexts.h

Issue 1294583006: Clean up native context slots and add new ones. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \ 87 V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \
88 V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \ 88 V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \
89 V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \ 89 V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \
90 V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \ 90 V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \
91 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ 91 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
92 V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \ 92 V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \
93 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \ 93 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
94 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \ 94 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
95 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \ 95 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
96 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \ 96 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \
97 V(DATE_FUNCTION_INDEX, JSFunction, date_function) \
98 V(JSON_OBJECT_INDEX, JSObject, json_object) \
99 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ 97 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
100 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \ 98 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
101 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \ 99 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \
100 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \
102 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \ 101 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
103 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \ 102 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
104 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \ 103 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
105 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \ 104 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
105 V(NO_SIDE_EFFECT_TO_STRING_FUN_INDEX, JSFunction, \
106 no_side_effect_to_string_fun) \
106 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \ 107 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
107 V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \ 108 V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \
108 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \ 109 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
109 V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \ 110 V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \
110 V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \ 111 V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \
111 V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \ 112 V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \
112 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ 113 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \
113 V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \ 114 V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \
114 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ 115 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \
115 V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \ 116 V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \
(...skipping 13 matching lines...) Expand all
129 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ 130 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
130 strict_function_without_prototype_map) \ 131 strict_function_without_prototype_map) \
131 V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \ 132 V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \
132 V(BOUND_FUNCTION_MAP_INDEX, Map, bound_function_map) \ 133 V(BOUND_FUNCTION_MAP_INDEX, Map, bound_function_map) \
133 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \ 134 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \
134 V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \ 135 V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \
135 V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \ 136 V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \
136 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \ 137 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \
137 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ 138 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \
138 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \ 139 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
139 V(MAKE_MESSAGE_FUN_INDEX, JSFunction, make_message_fun) \
140 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \ 140 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
141 V(CONFIGURE_GLOBAL_INDEX, JSFunction, configure_global_fun) \
142 V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \ 141 V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \
143 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ 142 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \
144 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ 143 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
145 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ 144 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
146 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ 145 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
147 call_as_constructor_delegate) \ 146 call_as_constructor_delegate) \
148 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ 147 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
149 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ 148 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
150 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ 149 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
151 V(MAP_CACHE_INDEX, Object, map_cache) \ 150 V(MAP_CACHE_INDEX, Object, map_cache) \
152 V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \ 151 V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \
153 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \
154 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ 152 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
155 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \ 153 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \
156 error_message_for_code_gen_from_strings) \ 154 error_message_for_code_gen_from_strings) \
155 V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \
156 V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \
157 V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \
158 V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \
159 V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \
160 V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \
161 V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function) \
157 V(PROMISE_STATUS_INDEX, Symbol, promise_status) \ 162 V(PROMISE_STATUS_INDEX, Symbol, promise_status) \
158 V(PROMISE_VALUE_INDEX, Symbol, promise_value) \ 163 V(PROMISE_VALUE_INDEX, Symbol, promise_value) \
159 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ 164 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \
160 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ 165 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \
161 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ 166 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \
162 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \ 167 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \
163 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \ 168 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
164 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ 169 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \
170 V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \
171 promise_has_user_defined_reject_handler) \
165 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ 172 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \
166 to_complete_property_descriptor) \ 173 to_complete_property_descriptor) \
174 V(JSON_SERIALIZE_ADAPTER_INDEX, JSFunction, json_serialize_adapter) \
167 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ 175 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \
168 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ 176 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \
169 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ 177 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \
170 V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \ 178 V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \
171 V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \ 179 V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \
172 V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \ 180 V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \
173 V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \ 181 V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \
174 V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \ 182 V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \
175 V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \ 183 V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \
176 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \ 184 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 enum { 324 enum {
317 // These slots are in all contexts. 325 // These slots are in all contexts.
318 CLOSURE_INDEX, 326 CLOSURE_INDEX,
319 PREVIOUS_INDEX, 327 PREVIOUS_INDEX,
320 // The extension slot is used for either the global object (in global 328 // The extension slot is used for either the global object (in global
321 // contexts), eval extension object (function contexts), subject of with 329 // contexts), eval extension object (function contexts), subject of with
322 // (with contexts), or the variable name (catch contexts), the serialized 330 // (with contexts), or the variable name (catch contexts), the serialized
323 // scope info (block contexts), or the module instance (module contexts). 331 // scope info (block contexts), or the module instance (module contexts).
324 EXTENSION_INDEX, 332 EXTENSION_INDEX,
325 GLOBAL_OBJECT_INDEX, 333 GLOBAL_OBJECT_INDEX,
326 MIN_CONTEXT_SLOTS,
327
328 // This slot holds the thrown value in catch contexts.
329 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS,
330 334
331 // These slots are only in native contexts. 335 // These slots are only in native contexts.
332 GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS, 336 #define NATIVE_CONTEXT_SLOT(index, type, name) index,
333 SECURITY_TOKEN_INDEX, 337 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_SLOT)
334 SLOPPY_ARGUMENTS_MAP_INDEX, 338 #undef NATIVE_CONTEXT_SLOT
335 FAST_ALIASED_ARGUMENTS_MAP_INDEX,
336 SLOW_ALIASED_ARGUMENTS_MAP_INDEX,
337 STRICT_ARGUMENTS_MAP_INDEX,
338 REGEXP_RESULT_MAP_INDEX,
339 SLOPPY_FUNCTION_MAP_INDEX,
340 SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX,
341 STRICT_FUNCTION_MAP_INDEX,
342 STRONG_FUNCTION_MAP_INDEX,
343 SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
344 STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX,
345 STRONG_CONSTRUCTOR_MAP_INDEX,
346 BOUND_FUNCTION_MAP_INDEX,
347 INITIAL_OBJECT_PROTOTYPE_INDEX,
348 INITIAL_ARRAY_PROTOTYPE_INDEX,
349 BOOLEAN_FUNCTION_INDEX,
350 NUMBER_FUNCTION_INDEX,
351 STRING_FUNCTION_INDEX,
352 STRING_FUNCTION_PROTOTYPE_MAP_INDEX,
353 SYMBOL_FUNCTION_INDEX,
354 FLOAT32X4_FUNCTION_INDEX,
355 INT32X4_FUNCTION_INDEX,
356 BOOL32X4_FUNCTION_INDEX,
357 INT16X8_FUNCTION_INDEX,
358 BOOL16X8_FUNCTION_INDEX,
359 INT8X16_FUNCTION_INDEX,
360 BOOL8X16_FUNCTION_INDEX,
361 OBJECT_FUNCTION_INDEX,
362 JS_OBJECT_STRONG_MAP_INDEX,
363 INTERNAL_ARRAY_FUNCTION_INDEX,
364 ARRAY_FUNCTION_INDEX,
365 JS_ARRAY_MAPS_INDEX,
366 JS_ARRAY_STRONG_MAPS_INDEX,
367 DATE_FUNCTION_INDEX,
368 JSON_OBJECT_INDEX,
369 REGEXP_FUNCTION_INDEX,
370 CREATE_DATE_FUN_INDEX,
371 TO_NUMBER_FUN_INDEX,
372 TO_STRING_FUN_INDEX,
373 TO_DETAIL_STRING_FUN_INDEX,
374 TO_INTEGER_FUN_INDEX,
375 GLOBAL_EVAL_FUN_INDEX,
376 ARRAY_BUFFER_FUN_INDEX,
377 ARRAY_BUFFER_MAP_INDEX,
378 UINT8_ARRAY_FUN_INDEX,
379 INT8_ARRAY_FUN_INDEX,
380 UINT16_ARRAY_FUN_INDEX,
381 INT16_ARRAY_FUN_INDEX,
382 UINT32_ARRAY_FUN_INDEX,
383 INT32_ARRAY_FUN_INDEX,
384 FLOAT32_ARRAY_FUN_INDEX,
385 FLOAT64_ARRAY_FUN_INDEX,
386 UINT8_CLAMPED_ARRAY_FUN_INDEX,
387 INT8_ARRAY_EXTERNAL_MAP_INDEX,
388 UINT8_ARRAY_EXTERNAL_MAP_INDEX,
389 INT16_ARRAY_EXTERNAL_MAP_INDEX,
390 UINT16_ARRAY_EXTERNAL_MAP_INDEX,
391 INT32_ARRAY_EXTERNAL_MAP_INDEX,
392 UINT32_ARRAY_EXTERNAL_MAP_INDEX,
393 FLOAT32_ARRAY_EXTERNAL_MAP_INDEX,
394 FLOAT64_ARRAY_EXTERNAL_MAP_INDEX,
395 UINT8_CLAMPED_ARRAY_EXTERNAL_MAP_INDEX,
396 DATA_VIEW_FUN_INDEX,
397 SHARED_ARRAY_BUFFER_FUN_INDEX,
398 MESSAGE_LISTENERS_INDEX,
399 MAKE_MESSAGE_FUN_INDEX,
400 GET_STACK_TRACE_LINE_INDEX,
401 CONFIGURE_GLOBAL_INDEX,
402 FUNCTION_CACHE_INDEX,
403 NORMALIZED_MAP_CACHE_INDEX,
404 RUNTIME_CONTEXT_INDEX,
405 CALL_AS_FUNCTION_DELEGATE_INDEX,
406 CALL_AS_CONSTRUCTOR_DELEGATE_INDEX,
407 SCRIPT_FUNCTION_INDEX,
408 OPAQUE_REFERENCE_FUNCTION_INDEX,
409 CONTEXT_EXTENSION_FUNCTION_INDEX,
410 OUT_OF_MEMORY_INDEX,
411 EMBEDDER_DATA_INDEX,
412 ALLOW_CODE_GEN_FROM_STRINGS_INDEX,
413 ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX,
414 RUN_MICROTASKS_INDEX,
415 ENQUEUE_MICROTASK_INDEX,
416 PROMISE_STATUS_INDEX,
417 PROMISE_VALUE_INDEX,
418 PROMISE_CREATE_INDEX,
419 PROMISE_RESOLVE_INDEX,
420 PROMISE_REJECT_INDEX,
421 PROMISE_CHAIN_INDEX,
422 PROMISE_CATCH_INDEX,
423 PROMISE_THEN_INDEX,
424 TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX,
425 DERIVED_HAS_TRAP_INDEX,
426 DERIVED_GET_TRAP_INDEX,
427 DERIVED_SET_TRAP_INDEX,
428 PROXY_ENUMERATE_INDEX,
429 OBSERVERS_NOTIFY_CHANGE_INDEX,
430 OBSERVERS_ENQUEUE_SPLICE_INDEX,
431 OBSERVERS_BEGIN_SPLICE_INDEX,
432 OBSERVERS_END_SPLICE_INDEX,
433 NATIVE_OBJECT_OBSERVE_INDEX,
434 NATIVE_OBJECT_GET_NOTIFIER_INDEX,
435 NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE,
436 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX,
437 STRICT_GENERATOR_FUNCTION_MAP_INDEX,
438 STRONG_GENERATOR_FUNCTION_MAP_INDEX,
439 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX,
440 ITERATOR_RESULT_MAP_INDEX,
441 JS_MAP_FUN_INDEX,
442 JS_MAP_MAP_INDEX,
443 JS_SET_FUN_INDEX,
444 JS_SET_MAP_INDEX,
445 MAP_GET_METHOD_INDEX,
446 MAP_SET_METHOD_INDEX,
447 MAP_HAS_METHOD_INDEX,
448 MAP_DELETE_METHOD_INDEX,
449 SET_ADD_METHOD_INDEX,
450 SET_HAS_METHOD_INDEX,
451 SET_DELETE_METHOD_INDEX,
452 MAP_FROM_ARRAY_INDEX,
453 SET_FROM_ARRAY_INDEX,
454 MAP_ITERATOR_MAP_INDEX,
455 SET_ITERATOR_MAP_INDEX,
456 ARRAY_VALUES_ITERATOR_INDEX,
457 SCRIPT_CONTEXT_TABLE_INDEX,
458 MAP_CACHE_INDEX,
459 STRONG_MAP_CACHE_INDEX,
460 TO_LENGTH_FUN_INDEX,
461 NATIVES_UTILS_OBJECT_INDEX,
462 EXTRAS_EXPORTS_OBJECT_INDEX,
463 CODE_STUB_EXPORTS_OBJECT_INDEX,
464 339
465 // Properties from here are treated as weak references by the full GC. 340 // Properties from here are treated as weak references by the full GC.
466 // Scavenge treats them as strong references. 341 // Scavenge treats them as strong references.
467 OPTIMIZED_FUNCTIONS_LIST, // Weak. 342 OPTIMIZED_FUNCTIONS_LIST, // Weak.
468 OPTIMIZED_CODE_LIST, // Weak. 343 OPTIMIZED_CODE_LIST, // Weak.
469 DEOPTIMIZED_CODE_LIST, // Weak. 344 DEOPTIMIZED_CODE_LIST, // Weak.
470 NEXT_CONTEXT_LINK, // Weak. 345 NEXT_CONTEXT_LINK, // Weak.
471 346
472 // Total number of slots. 347 // Total number of slots.
473 NATIVE_CONTEXT_SLOTS, 348 NATIVE_CONTEXT_SLOTS,
474 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST 349 FIRST_WEAK_SLOT = OPTIMIZED_FUNCTIONS_LIST,
350
351 MIN_CONTEXT_SLOTS = GLOBAL_PROXY_INDEX,
352 // This slot holds the thrown value in catch contexts.
353 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS,
475 }; 354 };
476 355
477 // Direct slot access. 356 // Direct slot access.
478 JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); } 357 JSFunction* closure() { return JSFunction::cast(get(CLOSURE_INDEX)); }
479 void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); } 358 void set_closure(JSFunction* closure) { set(CLOSURE_INDEX, closure); }
480 359
481 Context* previous() { 360 Context* previous() {
482 Object* result = unchecked_previous(); 361 Object* result = unchecked_previous();
483 DCHECK(IsBootstrappingOrValidParentContext(result, this)); 362 DCHECK(IsBootstrappingOrValidParentContext(result, this));
484 return reinterpret_cast<Context*>(result); 363 return reinterpret_cast<Context*>(result);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); 543 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object);
665 #endif 544 #endif
666 545
667 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); 546 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize);
668 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); 547 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex);
669 }; 548 };
670 549
671 } } // namespace v8::internal 550 } } // namespace v8::internal
672 551
673 #endif // V8_CONTEXTS_H_ 552 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698