| 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 static int SlotOffset(int index) { | 567 static int SlotOffset(int index) { |
| 568 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 568 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
| 569 } | 569 } |
| 570 | 570 |
| 571 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { | 571 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { |
| 572 if (IsGeneratorFunction(kind)) { | 572 if (IsGeneratorFunction(kind)) { |
| 573 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX | 573 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX |
| 574 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; | 574 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; |
| 575 } | 575 } |
| 576 | 576 |
| 577 if (IsArrowFunction(kind) || IsConciseMethod(kind)) { | 577 if (IsArrowFunction(kind) || IsConciseMethod(kind) || |
| 578 IsAccessorFunction(kind)) { |
| 578 return is_strict(language_mode) | 579 return is_strict(language_mode) |
| 579 ? STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX | 580 ? STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX |
| 580 : SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; | 581 : SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; |
| 581 } | 582 } |
| 582 | 583 |
| 583 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX | 584 return is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX |
| 584 : SLOPPY_FUNCTION_MAP_INDEX; | 585 : SLOPPY_FUNCTION_MAP_INDEX; |
| 585 } | 586 } |
| 586 | 587 |
| 587 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; | 588 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 605 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 606 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 606 #endif | 607 #endif |
| 607 | 608 |
| 608 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 609 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 609 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 610 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 610 }; | 611 }; |
| 611 | 612 |
| 612 } } // namespace v8::internal | 613 } } // namespace v8::internal |
| 613 | 614 |
| 614 #endif // V8_CONTEXTS_H_ | 615 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |