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

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: 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 4a8c65d6939374b6009230f61b4646979bd62012..41dc76efc655374836f8e8377661a87bbee237ae 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());
+ set_function_data(Smi::FromInt(id));
+}
bool SharedFunctionInfo::HasBytecodeArray() {
return function_data()->IsBytecodeArray();
@@ -5839,6 +5847,11 @@ BytecodeArray* SharedFunctionInfo::bytecode_array() {
return BytecodeArray::cast(function_data());
}
+void SharedFunctionInfo::set_bytecode_array(Object* bytecode) {
+ DCHECK(bytecode->IsBytecodeArray() || bytecode->IsUndefined());
rmcilroy 2016/02/25 14:18:06 Is this ever set to undefined other than the test
Michael Starzinger 2016/02/25 14:43:43 Done. Only done in the test. Added the ClearByteco
+ DCHECK(function_data()->IsUndefined() || HasBytecodeArray());
+ set_function_data(bytecode);
+}
int SharedFunctionInfo::ic_age() {
return ICAgeBits::decode(counters());
« src/objects.h ('K') | « src/objects.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698