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

Unified Diff: src/compiler.cc

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/bootstrapper.cc ('k') | src/objects.h » ('j') | src/objects-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index c47e1b7bee8a88c226b19dafdcdd8e9b9016cce6..f267ec103141101db50b4bea1e4b2e611d08f566 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -838,8 +838,8 @@ MUST_USE_RESULT static MaybeHandle<Code> GetUnoptimizedCodeCommon(
shared->ReplaceCode(*info->code());
shared->set_feedback_vector(*info->feedback_vector());
if (info->has_bytecode_array()) {
- DCHECK(shared->function_data()->IsUndefined());
- shared->set_function_data(*info->bytecode_array());
+ DCHECK(!shared->HasBytecodeArray()); // Only compiled once.
+ shared->set_bytecode_array(*info->bytecode_array());
}
return info->code();
@@ -1308,8 +1308,8 @@ static Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
ScopeInfo::Create(info->isolate(), info->zone(), info->scope()),
info->feedback_vector());
if (info->has_bytecode_array()) {
- DCHECK(result->function_data()->IsUndefined());
- result->set_function_data(*info->bytecode_array());
+ DCHECK(!result->HasBytecodeArray()); // Only compiled once.
+ result->set_bytecode_array(*info->bytecode_array());
}
DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position());
@@ -1669,8 +1669,8 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
literal->name(), literal->materialized_literal_count(),
literal->kind(), info.code(), scope_info, info.feedback_vector());
if (info.has_bytecode_array()) {
- DCHECK(result->function_data()->IsUndefined());
- result->set_function_data(*info.bytecode_array());
+ DCHECK(!result->HasBytecodeArray()); // Only compiled once.
+ result->set_bytecode_array(*info.bytecode_array());
}
SharedFunctionInfo::InitFromFunctionLiteral(result, literal);
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698