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

Side by Side Diff: src/contexts.h

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« src/ast.h ('K') | « src/compiler.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
11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 14
14 15
15 enum ContextLookupFlags { 16 enum ContextLookupFlags {
16 FOLLOW_CONTEXT_CHAIN = 1, 17 FOLLOW_CONTEXT_CHAIN = 1,
17 FOLLOW_PROTOTYPE_CHAIN = 2, 18 FOLLOW_PROTOTYPE_CHAIN = 2,
18 19
19 DONT_FOLLOW_CHAINS = 0, 20 DONT_FOLLOW_CHAINS = 0,
20 FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN 21 FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 ContextLookupFlags flags, 545 ContextLookupFlags flags,
545 int* index, 546 int* index,
546 PropertyAttributes* attributes, 547 PropertyAttributes* attributes,
547 BindingFlags* binding_flags); 548 BindingFlags* binding_flags);
548 549
549 // Code generation support. 550 // Code generation support.
550 static int SlotOffset(int index) { 551 static int SlotOffset(int index) {
551 return kHeaderSize + index * kPointerSize - kHeapObjectTag; 552 return kHeaderSize + index * kPointerSize - kHeapObjectTag;
552 } 553 }
553 554
554 static int FunctionMapIndex(StrictMode strict_mode, bool is_generator) { 555 static int FunctionMapIndex(StrictMode strict_mode, FunctionKind kind) {
555 return is_generator 556 if (kind == FunctionKind::kGeneratorFunction) {
556 ? (strict_mode == SLOPPY 557 return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX
557 ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX 558 : STRICT_GENERATOR_FUNCTION_MAP_INDEX;
558 : STRICT_GENERATOR_FUNCTION_MAP_INDEX) 559 }
559 : (strict_mode == SLOPPY 560
560 ? SLOPPY_FUNCTION_MAP_INDEX 561 if (kind == FunctionKind::kConciseMethod) {
561 : STRICT_FUNCTION_MAP_INDEX); 562 return strict_mode == SLOPPY
563 ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX
564 : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX;
565 }
566
567 return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX
568 : STRICT_FUNCTION_MAP_INDEX;
562 } 569 }
563 570
564 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; 571 static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize;
565 572
566 // GC support. 573 // GC support.
567 typedef FixedBodyDescriptor< 574 typedef FixedBodyDescriptor<
568 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; 575 kHeaderSize, kSize, kSize> ScavengeBodyDescriptor;
569 576
570 typedef FixedBodyDescriptor< 577 typedef FixedBodyDescriptor<
571 kHeaderSize, 578 kHeaderSize,
(...skipping 10 matching lines...) Expand all
582 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); 589 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object);
583 #endif 590 #endif
584 591
585 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); 592 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize);
586 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); 593 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex);
587 }; 594 };
588 595
589 } } // namespace v8::internal 596 } } // namespace v8::internal
590 597
591 #endif // V8_CONTEXTS_H_ 598 #endif // V8_CONTEXTS_H_
OLDNEW
« src/ast.h ('K') | « src/compiler.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698