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

Side by Side Diff: src/contexts.h

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: rebased Created 4 years 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/code-stubs.cc ('k') | src/factory.h » ('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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 V(SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP, Map, \ 315 V(SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP, Map, \
316 slow_object_with_null_prototype_map) \ 316 slow_object_with_null_prototype_map) \
317 V(SLOW_TEMPLATE_INSTANTIATIONS_CACHE_INDEX, UnseededNumberDictionary, \ 317 V(SLOW_TEMPLATE_INSTANTIATIONS_CACHE_INDEX, UnseededNumberDictionary, \
318 slow_template_instantiations_cache) \ 318 slow_template_instantiations_cache) \
319 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ 319 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \
320 V(STRICT_ASYNC_FUNCTION_MAP_INDEX, Map, strict_async_function_map) \ 320 V(STRICT_ASYNC_FUNCTION_MAP_INDEX, Map, strict_async_function_map) \
321 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \ 321 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \
322 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ 322 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
323 strict_function_without_prototype_map) \ 323 strict_function_without_prototype_map) \
324 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ 324 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \
325 V(CLASS_FUNCTION_MAP_INDEX, Map, class_function_map) \
325 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ 326 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \
326 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ 327 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \
327 V(STRING_ITERATOR_MAP_INDEX, Map, string_iterator_map) \ 328 V(STRING_ITERATOR_MAP_INDEX, Map, string_iterator_map) \
328 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ 329 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \
329 V(WASM_FUNCTION_MAP_INDEX, Map, wasm_function_map) \ 330 V(WASM_FUNCTION_MAP_INDEX, Map, wasm_function_map) \
330 V(WASM_INSTANCE_CONSTRUCTOR_INDEX, JSFunction, wasm_instance_constructor) \ 331 V(WASM_INSTANCE_CONSTRUCTOR_INDEX, JSFunction, wasm_instance_constructor) \
331 V(WASM_INSTANCE_SYM_INDEX, Symbol, wasm_instance_sym) \ 332 V(WASM_INSTANCE_SYM_INDEX, Symbol, wasm_instance_sym) \
332 V(WASM_MEMORY_CONSTRUCTOR_INDEX, JSFunction, wasm_memory_constructor) \ 333 V(WASM_MEMORY_CONSTRUCTOR_INDEX, JSFunction, wasm_memory_constructor) \
333 V(WASM_MEMORY_SYM_INDEX, Symbol, wasm_memory_sym) \ 334 V(WASM_MEMORY_SYM_INDEX, Symbol, wasm_memory_sym) \
334 V(WASM_MODULE_CONSTRUCTOR_INDEX, JSFunction, wasm_module_constructor) \ 335 V(WASM_MODULE_CONSTRUCTOR_INDEX, JSFunction, wasm_module_constructor) \
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX 617 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX
617 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; 618 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX;
618 } 619 }
619 620
620 if (IsAsyncFunction(kind)) { 621 if (IsAsyncFunction(kind)) {
621 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX 622 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX
622 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX; 623 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX;
623 } 624 }
624 625
625 if (IsClassConstructor(kind)) { 626 if (IsClassConstructor(kind)) {
626 // Use strict function map (no own "caller" / "arguments") 627 // Like the strict function map, but with no 'name' accessor. 'name'
627 return STRICT_FUNCTION_MAP_INDEX; 628 // needs to be the last property and it is added during instantiation,
629 // in case a static property with the same name exists"
630 return CLASS_FUNCTION_MAP_INDEX;
628 } 631 }
629 632
630 if (IsArrowFunction(kind) || IsConciseMethod(kind) || 633 if (IsArrowFunction(kind) || IsConciseMethod(kind) ||
631 IsAccessorFunction(kind)) { 634 IsAccessorFunction(kind)) {
632 return STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; 635 return STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
633 } 636 }
634 637
635 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX 638 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX
636 : SLOPPY_FUNCTION_MAP_INDEX; 639 : SLOPPY_FUNCTION_MAP_INDEX;
637 } 640 }
(...skipping 26 matching lines...) Expand all
664 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); 667 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize);
665 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); 668 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex);
666 }; 669 };
667 670
668 typedef Context::Field ContextField; 671 typedef Context::Field ContextField;
669 672
670 } // namespace internal 673 } // namespace internal
671 } // namespace v8 674 } // namespace v8
672 675
673 #endif // V8_CONTEXTS_H_ 676 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698