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

Side by Side Diff: src/objects-inl.h

Issue 2372373002: Remove getters that duplicate FunctionKind in SharedFunctionInfo and ParseInfo (Closed)
Patch Set: Remove SharedFunctionInfo::is_resumable and FunctionState stuff Created 4 years, 2 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/objects.cc ('k') | src/objects-printer.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 // 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 6078 matching lines...) Expand 10 before | Expand all | Expand 10 after
6089 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { 6089 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) {
6090 STATIC_ASSERT(LANGUAGE_END == 2); 6090 STATIC_ASSERT(LANGUAGE_END == 2);
6091 // We only allow language mode transitions that set the same language mode 6091 // We only allow language mode transitions that set the same language mode
6092 // again or go up in the chain: 6092 // again or go up in the chain:
6093 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); 6093 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode));
6094 int hints = compiler_hints(); 6094 int hints = compiler_hints();
6095 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); 6095 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode));
6096 set_compiler_hints(hints); 6096 set_compiler_hints(hints);
6097 } 6097 }
6098 6098
6099 6099 FunctionKind SharedFunctionInfo::kind() const {
6100 FunctionKind SharedFunctionInfo::kind() {
6101 return FunctionKindBits::decode(compiler_hints()); 6100 return FunctionKindBits::decode(compiler_hints());
6102 } 6101 }
6103 6102
6104 6103
6105 void SharedFunctionInfo::set_kind(FunctionKind kind) { 6104 void SharedFunctionInfo::set_kind(FunctionKind kind) {
6106 DCHECK(IsValidFunctionKind(kind)); 6105 DCHECK(IsValidFunctionKind(kind));
6107 int hints = compiler_hints(); 6106 int hints = compiler_hints();
6108 hints = FunctionKindBits::update(hints, kind); 6107 hints = FunctionKindBits::update(hints, kind);
6109 set_compiler_hints(hints); 6108 set_compiler_hints(hints);
6110 } 6109 }
6111 6110
6112 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, 6111 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object,
6113 kNeedsHomeObject) 6112 kNeedsHomeObject)
6114 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative) 6113 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
6115 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline) 6114 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline)
6116 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, 6115 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
6117 name_should_print_as_anonymous, 6116 name_should_print_as_anonymous,
6118 kNameShouldPrintAsAnonymous) 6117 kNameShouldPrintAsAnonymous)
6119 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous_expression, 6118 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous_expression,
6120 kIsAnonymousExpression) 6119 kIsAnonymousExpression)
6121 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction) 6120 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction)
6122 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_crankshaft, 6121 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_crankshaft,
6123 kDontCrankshaft) 6122 kDontCrankshaft)
6124 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush) 6123 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush)
6125 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_arrow, kIsArrow)
6126 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator)
6127 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_async, kIsAsyncFunction)
6128 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_concise_method,
6129 kIsConciseMethod)
6130 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_getter_function,
6131 kIsGetterFunction)
6132 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_setter_function,
6133 kIsSetterFunction)
6134 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_default_constructor,
6135 kIsDefaultConstructor)
6136 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_asm_wasm_broken, 6124 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_asm_wasm_broken,
6137 kIsAsmWasmBroken) 6125 kIsAsmWasmBroken)
6138 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, requires_class_field_init, 6126 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, requires_class_field_init,
6139 kRequiresClassFieldInit) 6127 kRequiresClassFieldInit)
6140 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_class_field_initializer, 6128 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_class_field_initializer,
6141 kIsClassFieldInitializer) 6129 kIsClassFieldInitializer)
6142 6130
6143 inline bool SharedFunctionInfo::is_resumable() const {
6144 return is_generator() || is_async();
6145 }
6146
6147 bool Script::HasValidSource() { 6131 bool Script::HasValidSource() {
6148 Object* src = this->source(); 6132 Object* src = this->source();
6149 if (!src->IsString()) return true; 6133 if (!src->IsString()) return true;
6150 String* src_str = String::cast(src); 6134 String* src_str = String::cast(src);
6151 if (!StringShape(src_str).IsExternal()) return true; 6135 if (!StringShape(src_str).IsExternal()) return true;
6152 if (src_str->IsOneByteRepresentation()) { 6136 if (src_str->IsOneByteRepresentation()) {
6153 return ExternalOneByteString::cast(src)->resource() != NULL; 6137 return ExternalOneByteString::cast(src)->resource() != NULL;
6154 } else if (src_str->IsTwoByteRepresentation()) { 6138 } else if (src_str->IsTwoByteRepresentation()) {
6155 return ExternalTwoByteString::cast(src)->resource() != NULL; 6139 return ExternalTwoByteString::cast(src)->resource() != NULL;
6156 } 6140 }
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
8335 #undef WRITE_INT64_FIELD 8319 #undef WRITE_INT64_FIELD
8336 #undef READ_BYTE_FIELD 8320 #undef READ_BYTE_FIELD
8337 #undef WRITE_BYTE_FIELD 8321 #undef WRITE_BYTE_FIELD
8338 #undef NOBARRIER_READ_BYTE_FIELD 8322 #undef NOBARRIER_READ_BYTE_FIELD
8339 #undef NOBARRIER_WRITE_BYTE_FIELD 8323 #undef NOBARRIER_WRITE_BYTE_FIELD
8340 8324
8341 } // namespace internal 8325 } // namespace internal
8342 } // namespace v8 8326 } // namespace v8
8343 8327
8344 #endif // V8_OBJECTS_INL_H_ 8328 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698