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

Unified Diff: src/objects-inl.h

Issue 1801023002: [Interpreter]: Move builtin-id from function_data to function_identifier. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove UNREACHABLE() Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 753c80e5bb4db517c0815dfee109e550448d3ad5..619fb778ecd637d7f1a960460644c6550d7353b6 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5589,8 +5589,8 @@ ACCESSORS(SharedFunctionInfo, instance_class_name, Object,
ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset)
ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset)
ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset)
-ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset)
-
+ACCESSORS(SharedFunctionInfo, function_identifier, Object,
+ kFunctionIdentifierOffset)
SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset)
BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype,
@@ -5923,21 +5923,6 @@ void SharedFunctionInfo::set_api_func_data(FunctionTemplateInfo* data) {
set_function_data(data);
}
-bool SharedFunctionInfo::HasBuiltinFunctionId() {
- return function_data()->IsSmi();
-}
-
-
-BuiltinFunctionId SharedFunctionInfo::builtin_function_id() {
- DCHECK(HasBuiltinFunctionId());
- return static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value());
-}
-
-void SharedFunctionInfo::set_builtin_function_id(BuiltinFunctionId id) {
- DCHECK(function_data()->IsUndefined() || HasBuiltinFunctionId());
- set_function_data(Smi::FromInt(id));
-}
-
bool SharedFunctionInfo::HasBytecodeArray() {
return function_data()->IsBytecodeArray();
}
@@ -5958,6 +5943,37 @@ void SharedFunctionInfo::ClearBytecodeArray() {
set_function_data(GetHeap()->undefined_value());
}
+bool SharedFunctionInfo::HasBuiltinFunctionId() {
+ return function_identifier()->IsSmi();
+}
+
+BuiltinFunctionId SharedFunctionInfo::builtin_function_id() {
+ DCHECK(HasBuiltinFunctionId());
+ return static_cast<BuiltinFunctionId>(
+ Smi::cast(function_identifier())->value());
+}
+
+void SharedFunctionInfo::set_builtin_function_id(BuiltinFunctionId id) {
+ set_function_identifier(Smi::FromInt(id));
+}
+
+bool SharedFunctionInfo::HasInferredName() {
+ return function_identifier()->IsString();
+}
+
+String* SharedFunctionInfo::inferred_name() {
+ if (HasInferredName()) {
+ return String::cast(function_identifier());
+ }
+ DCHECK(function_identifier()->IsUndefined() || HasBuiltinFunctionId());
+ return GetIsolate()->heap()->empty_string();
+}
+
+void SharedFunctionInfo::set_inferred_name(String* inferred_name) {
+ DCHECK(function_identifier()->IsUndefined() || HasInferredName());
+ set_function_identifier(inferred_name);
+}
+
int SharedFunctionInfo::ic_age() {
return ICAgeBits::decode(counters());
}
« no previous file with comments | « src/objects.h ('k') | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698