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

Unified Diff: src/objects-inl.h

Issue 1730853005: [interpreter] Make setting of function data more resilient. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-test-enable-strong
Patch Set: Addressed comments. Created 4 years, 10 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/runtime/runtime-function.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 4a8c65d6939374b6009230f61b4646979bd62012..16986cfcba3717e57de6b8f97d63522afa58d01a 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5817,6 +5817,10 @@ FunctionTemplateInfo* SharedFunctionInfo::get_api_func_data() {
return FunctionTemplateInfo::cast(function_data());
}
+void SharedFunctionInfo::set_api_func_data(FunctionTemplateInfo* data) {
+ DCHECK(function_data()->IsUndefined());
+ set_function_data(data);
+}
bool SharedFunctionInfo::HasBuiltinFunctionId() {
return function_data()->IsSmi();
@@ -5828,6 +5832,10 @@ BuiltinFunctionId SharedFunctionInfo::builtin_function_id() {
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();
@@ -5839,6 +5847,15 @@ BytecodeArray* SharedFunctionInfo::bytecode_array() {
return BytecodeArray::cast(function_data());
}
+void SharedFunctionInfo::set_bytecode_array(BytecodeArray* bytecode) {
+ DCHECK(function_data()->IsUndefined());
Michael Starzinger 2016/02/25 14:43:43 This would now imply the DCHECKs in compiler.cc ab
rmcilroy 2016/02/25 15:33:55 SGTM
+ set_function_data(bytecode);
+}
+
+void SharedFunctionInfo::ClearBytecodeArray() {
+ DCHECK(function_data()->IsUndefined() || HasBytecodeArray());
+ set_function_data(GetHeap()->undefined_value());
+}
int SharedFunctionInfo::ic_age() {
return ICAgeBits::decode(counters());
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698