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