| 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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 static int SlotOffset(int index) { | 552 static int SlotOffset(int index) { |
| 553 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 553 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
| 554 } | 554 } |
| 555 | 555 |
| 556 static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind) { | 556 static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind) { |
| 557 if (IsGeneratorFunction(kind)) { | 557 if (IsGeneratorFunction(kind)) { |
| 558 return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX | 558 return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX |
| 559 : STRICT_GENERATOR_FUNCTION_MAP_INDEX; | 559 : STRICT_GENERATOR_FUNCTION_MAP_INDEX; |
| 560 } | 560 } |
| 561 | 561 |
| 562 if (IsConciseMethod(kind)) { | 562 if (IsArrowFunction(kind) || IsConciseMethod(kind)) { |
| 563 return strict_mode == SLOPPY | 563 return strict_mode == SLOPPY |
| 564 ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX | 564 ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX |
| 565 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; | 565 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; |
| 566 } | 566 } |
| 567 | 567 |
| 568 return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX | 568 return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX |
| 569 : STRICT_FUNCTION_MAP_INDEX; | 569 : STRICT_FUNCTION_MAP_INDEX; |
| 570 } | 570 } |
| 571 | 571 |
| 572 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; | 572 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 590 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 590 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 591 #endif | 591 #endif |
| 592 | 592 |
| 593 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 593 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 594 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 594 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 595 }; | 595 }; |
| 596 | 596 |
| 597 } } // namespace v8::internal | 597 } } // namespace v8::internal |
| 598 | 598 |
| 599 #endif // V8_CONTEXTS_H_ | 599 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |