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

Side by Side Diff: src/contexts.h

Issue 1145213005: [strong] cache strong object literal maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix map comparison Created 5 years, 7 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/factory.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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 #define NATIVE_CONTEXT_FIELDS(V) \ 76 #define NATIVE_CONTEXT_FIELDS(V) \
77 V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \ 77 V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \
78 V(SECURITY_TOKEN_INDEX, Object, security_token) \ 78 V(SECURITY_TOKEN_INDEX, Object, security_token) \
79 V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \ 79 V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
80 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \ 80 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \
81 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ 81 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \
82 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ 82 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \
83 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ 83 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \
84 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ 84 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
85 V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \
85 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \ 86 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
86 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \ 87 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
87 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \ 88 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
88 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \ 89 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \
89 V(DATE_FUNCTION_INDEX, JSFunction, date_function) \ 90 V(DATE_FUNCTION_INDEX, JSFunction, date_function) \
90 V(JSON_OBJECT_INDEX, JSObject, json_object) \ 91 V(JSON_OBJECT_INDEX, JSObject, json_object) \
91 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ 92 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
92 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \ 93 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
93 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \ 94 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \
94 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \ 95 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 V(JSFUNCTION_RESULT_CACHES_INDEX, FixedArray, jsfunction_result_caches) \ 147 V(JSFUNCTION_RESULT_CACHES_INDEX, FixedArray, jsfunction_result_caches) \
147 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ 148 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \
148 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ 149 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
149 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ 150 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
150 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ 151 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
151 call_as_constructor_delegate) \ 152 call_as_constructor_delegate) \
152 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ 153 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
153 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ 154 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
154 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ 155 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
155 V(MAP_CACHE_INDEX, Object, map_cache) \ 156 V(MAP_CACHE_INDEX, Object, map_cache) \
157 V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \
156 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \ 158 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \
157 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ 159 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
158 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \ 160 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \
159 error_message_for_code_gen_from_strings) \ 161 error_message_for_code_gen_from_strings) \
160 V(PROMISE_STATUS_INDEX, Symbol, promise_status) \ 162 V(PROMISE_STATUS_INDEX, Symbol, promise_status) \
161 V(PROMISE_VALUE_INDEX, Symbol, promise_value) \ 163 V(PROMISE_VALUE_INDEX, Symbol, promise_value) \
162 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ 164 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \
163 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ 165 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \
164 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ 166 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \
165 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \ 167 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 STRONG_CONSTRUCTOR_MAP_INDEX, 335 STRONG_CONSTRUCTOR_MAP_INDEX,
334 BOUND_FUNCTION_MAP_INDEX, 336 BOUND_FUNCTION_MAP_INDEX,
335 INITIAL_OBJECT_PROTOTYPE_INDEX, 337 INITIAL_OBJECT_PROTOTYPE_INDEX,
336 INITIAL_ARRAY_PROTOTYPE_INDEX, 338 INITIAL_ARRAY_PROTOTYPE_INDEX,
337 BOOLEAN_FUNCTION_INDEX, 339 BOOLEAN_FUNCTION_INDEX,
338 NUMBER_FUNCTION_INDEX, 340 NUMBER_FUNCTION_INDEX,
339 STRING_FUNCTION_INDEX, 341 STRING_FUNCTION_INDEX,
340 STRING_FUNCTION_PROTOTYPE_MAP_INDEX, 342 STRING_FUNCTION_PROTOTYPE_MAP_INDEX,
341 SYMBOL_FUNCTION_INDEX, 343 SYMBOL_FUNCTION_INDEX,
342 OBJECT_FUNCTION_INDEX, 344 OBJECT_FUNCTION_INDEX,
345 JS_OBJECT_STRONG_MAP_INDEX,
343 INTERNAL_ARRAY_FUNCTION_INDEX, 346 INTERNAL_ARRAY_FUNCTION_INDEX,
344 ARRAY_FUNCTION_INDEX, 347 ARRAY_FUNCTION_INDEX,
345 JS_ARRAY_MAPS_INDEX, 348 JS_ARRAY_MAPS_INDEX,
346 JS_ARRAY_STRONG_MAPS_INDEX, 349 JS_ARRAY_STRONG_MAPS_INDEX,
347 DATE_FUNCTION_INDEX, 350 DATE_FUNCTION_INDEX,
348 JSON_OBJECT_INDEX, 351 JSON_OBJECT_INDEX,
349 REGEXP_FUNCTION_INDEX, 352 REGEXP_FUNCTION_INDEX,
350 CREATE_DATE_FUN_INDEX, 353 CREATE_DATE_FUN_INDEX,
351 TO_NUMBER_FUN_INDEX, 354 TO_NUMBER_FUN_INDEX,
352 TO_STRING_FUN_INDEX, 355 TO_STRING_FUN_INDEX,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, 423 SLOPPY_GENERATOR_FUNCTION_MAP_INDEX,
421 STRICT_GENERATOR_FUNCTION_MAP_INDEX, 424 STRICT_GENERATOR_FUNCTION_MAP_INDEX,
422 STRONG_GENERATOR_FUNCTION_MAP_INDEX, 425 STRONG_GENERATOR_FUNCTION_MAP_INDEX,
423 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, 426 GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX,
424 ITERATOR_RESULT_MAP_INDEX, 427 ITERATOR_RESULT_MAP_INDEX,
425 MAP_ITERATOR_MAP_INDEX, 428 MAP_ITERATOR_MAP_INDEX,
426 SET_ITERATOR_MAP_INDEX, 429 SET_ITERATOR_MAP_INDEX,
427 ARRAY_VALUES_ITERATOR_INDEX, 430 ARRAY_VALUES_ITERATOR_INDEX,
428 SCRIPT_CONTEXT_TABLE_INDEX, 431 SCRIPT_CONTEXT_TABLE_INDEX,
429 MAP_CACHE_INDEX, 432 MAP_CACHE_INDEX,
433 STRONG_MAP_CACHE_INDEX,
430 TO_LENGTH_FUN_INDEX, 434 TO_LENGTH_FUN_INDEX,
431 NATIVES_UTILS_OBJECT_INDEX, 435 NATIVES_UTILS_OBJECT_INDEX,
432 EXTRAS_EXPORTS_OBJECT_INDEX, 436 EXTRAS_EXPORTS_OBJECT_INDEX,
433 437
434 // Properties from here are treated as weak references by the full GC. 438 // Properties from here are treated as weak references by the full GC.
435 // Scavenge treats them as strong references. 439 // Scavenge treats them as strong references.
436 OPTIMIZED_FUNCTIONS_LIST, // Weak. 440 OPTIMIZED_FUNCTIONS_LIST, // Weak.
437 OPTIMIZED_CODE_LIST, // Weak. 441 OPTIMIZED_CODE_LIST, // Weak.
438 DEOPTIMIZED_CODE_LIST, // Weak. 442 DEOPTIMIZED_CODE_LIST, // Weak.
439 NEXT_CONTEXT_LINK, // Weak. 443 NEXT_CONTEXT_LINK, // Weak.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); 634 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object);
631 #endif 635 #endif
632 636
633 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); 637 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize);
634 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); 638 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex);
635 }; 639 };
636 640
637 } } // namespace v8::internal 641 } } // namespace v8::internal
638 642
639 #endif // V8_CONTEXTS_H_ 643 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698