| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 506 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
| 507 } | 507 } |
| 508 | 508 |
| 509 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { | 509 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { |
| 510 if (IsGeneratorFunction(kind)) { | 510 if (IsGeneratorFunction(kind)) { |
| 511 return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX : | 511 return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX : |
| 512 is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX | 512 is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX |
| 513 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; | 513 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; |
| 514 } | 514 } |
| 515 | 515 |
| 516 if (IsConstructor(kind)) { | 516 if (IsClassConstructor(kind)) { |
| 517 // Use strict function map (no own "caller" / "arguments") | 517 // Use strict function map (no own "caller" / "arguments") |
| 518 return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX | 518 return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX |
| 519 : STRICT_FUNCTION_MAP_INDEX; | 519 : STRICT_FUNCTION_MAP_INDEX; |
| 520 } | 520 } |
| 521 | 521 |
| 522 if (IsArrowFunction(kind) || IsConciseMethod(kind) || | 522 if (IsArrowFunction(kind) || IsConciseMethod(kind) || |
| 523 IsAccessorFunction(kind)) { | 523 IsAccessorFunction(kind)) { |
| 524 return is_strong(language_mode) | 524 return is_strong(language_mode) |
| 525 ? STRONG_FUNCTION_MAP_INDEX | 525 ? STRONG_FUNCTION_MAP_INDEX |
| 526 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; | 526 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 550 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 550 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
| 551 #endif | 551 #endif |
| 552 | 552 |
| 553 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 553 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
| 554 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 554 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
| 555 }; | 555 }; |
| 556 | 556 |
| 557 } } // namespace v8::internal | 557 } } // namespace v8::internal |
| 558 | 558 |
| 559 #endif // V8_CONTEXTS_H_ | 559 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |