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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 V(WASM_INSTANCE_SYM_INDEX, Symbol, wasm_instance_sym) \ | 302 V(WASM_INSTANCE_SYM_INDEX, Symbol, wasm_instance_sym) \ |
303 V(SLOPPY_ASYNC_FUNCTION_MAP_INDEX, Map, sloppy_async_function_map) \ | 303 V(SLOPPY_ASYNC_FUNCTION_MAP_INDEX, Map, sloppy_async_function_map) \ |
304 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ | 304 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ |
305 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \ | 305 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \ |
306 V(STRICT_ASYNC_FUNCTION_MAP_INDEX, Map, strict_async_function_map) \ | 306 V(STRICT_ASYNC_FUNCTION_MAP_INDEX, Map, strict_async_function_map) \ |
307 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ | 307 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ |
308 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \ | 308 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \ |
309 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ | 309 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ |
310 strict_function_without_prototype_map) \ | 310 strict_function_without_prototype_map) \ |
311 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ | 311 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ |
| 312 V(CLASS_FUNCTION_MAP_INDEX, Map, class_function_map) \ |
312 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ | 313 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ |
313 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ | 314 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ |
314 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ | 315 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ |
315 V(TYPED_ARRAY_FUN_INDEX, JSFunction, typed_array_function) \ | 316 V(TYPED_ARRAY_FUN_INDEX, JSFunction, typed_array_function) \ |
316 V(TYPED_ARRAY_PROTOTYPE_INDEX, JSObject, typed_array_prototype) \ | 317 V(TYPED_ARRAY_PROTOTYPE_INDEX, JSObject, typed_array_prototype) \ |
317 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ | 318 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ |
318 V(UINT16X8_FUNCTION_INDEX, JSFunction, uint16x8_function) \ | 319 V(UINT16X8_FUNCTION_INDEX, JSFunction, uint16x8_function) \ |
319 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ | 320 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ |
320 V(UINT32X4_FUNCTION_INDEX, JSFunction, uint32x4_function) \ | 321 V(UINT32X4_FUNCTION_INDEX, JSFunction, uint32x4_function) \ |
321 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ | 322 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX | 595 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX |
595 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; | 596 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; |
596 } | 597 } |
597 | 598 |
598 if (IsAsyncFunction(kind)) { | 599 if (IsAsyncFunction(kind)) { |
599 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX | 600 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX |
600 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX; | 601 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX; |
601 } | 602 } |
602 | 603 |
603 if (IsClassConstructor(kind)) { | 604 if (IsClassConstructor(kind)) { |
604 // Use strict function map (no own "caller" / "arguments") | 605 // Like the strict function map, but with no 'name' accessor. 'name' |
605 return STRICT_FUNCTION_MAP_INDEX; | 606 // needs to be the last property and it is added during instantiation, |
| 607 // in case a static property with the same name exists" |
| 608 return CLASS_FUNCTION_MAP_INDEX; |
606 } | 609 } |
607 | 610 |
608 if (IsArrowFunction(kind) || IsConciseMethod(kind) || | 611 if (IsArrowFunction(kind) || IsConciseMethod(kind) || |
609 IsAccessorFunction(kind)) { | 612 IsAccessorFunction(kind)) { |
610 return STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; | 613 return STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; |
611 } | 614 } |
612 | 615 |
613 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX | 616 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX |
614 : SLOPPY_FUNCTION_MAP_INDEX; | 617 : SLOPPY_FUNCTION_MAP_INDEX; |
615 } | 618 } |
(...skipping 26 matching lines...) Expand all Loading... |
642 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 645 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
643 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 646 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
644 }; | 647 }; |
645 | 648 |
646 typedef Context::Field ContextField; | 649 typedef Context::Field ContextField; |
647 | 650 |
648 } // namespace internal | 651 } // namespace internal |
649 } // namespace v8 | 652 } // namespace v8 |
650 | 653 |
651 #endif // V8_CONTEXTS_H_ | 654 #endif // V8_CONTEXTS_H_ |
OLD | NEW |