Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/contexts.h

Issue 1027283004: [es6] do not add caller/arguments to ES6 function definitions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins.cc ('k') | src/factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 } 575 }
576 576
577 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { 577 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) {
578 if (IsGeneratorFunction(kind)) { 578 if (IsGeneratorFunction(kind)) {
579 return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX : 579 return is_strong(language_mode) ? STRONG_GENERATOR_FUNCTION_MAP_INDEX :
580 is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX 580 is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX
581 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX; 581 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX;
582 } 582 }
583 583
584 if (IsConstructor(kind)) { 584 if (IsConstructor(kind)) {
585 return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX : 585 // Use strict function map (no own "caller" / "arguments")
586 is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX 586 return is_strong(language_mode) ? STRONG_CONSTRUCTOR_MAP_INDEX
587 : SLOPPY_FUNCTION_MAP_INDEX; 587 : STRICT_FUNCTION_MAP_INDEX;
588 } 588 }
589 589
590 if (IsArrowFunction(kind) || IsConciseMethod(kind) || 590 if (IsArrowFunction(kind) || IsConciseMethod(kind) ||
591 IsAccessorFunction(kind)) { 591 IsAccessorFunction(kind)) {
592 return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX : 592 return is_strong(language_mode)
593 is_strict(language_mode) ? 593 ? STRONG_FUNCTION_MAP_INDEX
594 STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX : 594 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
595 SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
596 } 595 }
597 596
598 return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX : 597 return is_strong(language_mode) ? STRONG_FUNCTION_MAP_INDEX :
599 is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX 598 is_strict(language_mode) ? STRICT_FUNCTION_MAP_INDEX
600 : SLOPPY_FUNCTION_MAP_INDEX; 599 : SLOPPY_FUNCTION_MAP_INDEX;
601 } 600 }
602 601
603 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; 602 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize;
604 603
605 // GC support. 604 // GC support.
(...skipping 15 matching lines...) Expand all
621 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); 620 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object);
622 #endif 621 #endif
623 622
624 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); 623 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize);
625 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); 624 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex);
626 }; 625 };
627 626
628 } } // namespace v8::internal 627 } } // namespace v8::internal
629 628
630 #endif // V8_CONTEXTS_H_ 629 #endif // V8_CONTEXTS_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698