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

Side by Side Diff: src/contexts.h

Issue 1358423002: [es6] Introduce spec compliant IsConstructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid fuzzer failure (constructor bit set on sloppy/strict arguments). Fix MIPS/MIPS64 typos, … Created 5 years, 3 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.h ('k') | src/factory.cc » ('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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698