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

Side by Side Diff: src/objects-inl.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, 4 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
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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 5572 matching lines...) Expand 10 before | Expand all | Expand 10 after
5583 5583
5584 void SharedFunctionInfo::set_strict_mode(StrictMode strict_mode) { 5584 void SharedFunctionInfo::set_strict_mode(StrictMode strict_mode) {
5585 // We only allow mode transitions from sloppy to strict. 5585 // We only allow mode transitions from sloppy to strict.
5586 DCHECK(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode); 5586 DCHECK(this->strict_mode() == SLOPPY || this->strict_mode() == strict_mode);
5587 int hints = compiler_hints(); 5587 int hints = compiler_hints();
5588 hints = BooleanBit::set(hints, kStrictModeFunction, strict_mode == STRICT); 5588 hints = BooleanBit::set(hints, kStrictModeFunction, strict_mode == STRICT);
5589 set_compiler_hints(hints); 5589 set_compiler_hints(hints);
5590 } 5590 }
5591 5591
5592 5592
5593 FunctionKind SharedFunctionInfo::kind() {
5594 return FunctionKindBits::decode(compiler_hints());
5595 }
5596
5597
5598 void SharedFunctionInfo::set_kind(FunctionKind kind) {
rossberg 2014/08/25 09:39:30 Assert that kind is well-formed.
arv (Not doing code reviews) 2014/09/09 22:24:27 Done.
5599 int hints = compiler_hints();
5600 hints = FunctionKindBits::update(hints, kind);
5601 set_compiler_hints(hints);
5602 }
5603
5604
5593 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) 5605 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
5594 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, inline_builtin, 5606 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, inline_builtin,
5595 kInlineBuiltin) 5607 kInlineBuiltin)
5596 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, 5608 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
5597 name_should_print_as_anonymous, 5609 name_should_print_as_anonymous,
5598 kNameShouldPrintAsAnonymous) 5610 kNameShouldPrintAsAnonymous)
5599 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction) 5611 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
5600 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous) 5612 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
5601 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction) 5613 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction)
5602 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache) 5614 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache)
5603 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush) 5615 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush)
5616 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_arrow, kIsArrow)
5604 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator) 5617 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator)
5605 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_arrow, kIsArrow) 5618 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_concise_method,
5619 kIsConciseMethod)
5606 5620
5607 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) 5621 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
5608 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) 5622 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
5609 5623
5610 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset) 5624 ACCESSORS(PolymorphicCodeCache, cache, Object, kCacheOffset)
5611 5625
5612 bool Script::HasValidSource() { 5626 bool Script::HasValidSource() {
5613 Object* src = this->source(); 5627 Object* src = this->source();
5614 if (!src->IsString()) return true; 5628 if (!src->IsString()) return true;
5615 String* src_str = String::cast(src); 5629 String* src_str = String::cast(src);
(...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after
7269 #undef READ_SHORT_FIELD 7283 #undef READ_SHORT_FIELD
7270 #undef WRITE_SHORT_FIELD 7284 #undef WRITE_SHORT_FIELD
7271 #undef READ_BYTE_FIELD 7285 #undef READ_BYTE_FIELD
7272 #undef WRITE_BYTE_FIELD 7286 #undef WRITE_BYTE_FIELD
7273 #undef NOBARRIER_READ_BYTE_FIELD 7287 #undef NOBARRIER_READ_BYTE_FIELD
7274 #undef NOBARRIER_WRITE_BYTE_FIELD 7288 #undef NOBARRIER_WRITE_BYTE_FIELD
7275 7289
7276 } } // namespace v8::internal 7290 } } // namespace v8::internal
7277 7291
7278 #endif // V8_OBJECTS_INL_H_ 7292 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698