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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 int* index, PropertyAttributes* attributes, | 631 int* index, PropertyAttributes* attributes, |
632 InitializationFlag* init_flag, | 632 InitializationFlag* init_flag, |
633 VariableMode* variable_mode); | 633 VariableMode* variable_mode); |
634 | 634 |
635 // Code generation support. | 635 // Code generation support. |
636 static int SlotOffset(int index) { | 636 static int SlotOffset(int index) { |
637 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 637 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
638 } | 638 } |
639 | 639 |
640 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { | 640 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { |
641 // Note: Must be kept in sync with FastNewClosureStub::Generate. | 641 // Note: Must be kept in sync with the FastNewClosure builtin. |
642 if (IsGeneratorFunction(kind)) { | 642 if (IsGeneratorFunction(kind)) { |
643 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX | 643 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX |
644 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; | 644 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; |
645 } | 645 } |
646 | 646 |
647 if (IsAsyncFunction(kind)) { | 647 if (IsAsyncFunction(kind)) { |
648 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX | 648 return is_strict(language_mode) ? STRICT_ASYNC_FUNCTION_MAP_INDEX |
649 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX; | 649 : SLOPPY_ASYNC_FUNCTION_MAP_INDEX; |
650 } | 650 } |
651 | 651 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 693 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
694 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 694 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
695 }; | 695 }; |
696 | 696 |
697 typedef Context::Field ContextField; | 697 typedef Context::Field ContextField; |
698 | 698 |
699 } // namespace internal | 699 } // namespace internal |
700 } // namespace v8 | 700 } // namespace v8 |
701 | 701 |
702 #endif // V8_CONTEXTS_H_ | 702 #endif // V8_CONTEXTS_H_ |
OLD | NEW |