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

Unified Diff: src/debug/liveedit.cc

Issue 2044063002: [compiler] Improve contract for Compiler::CompileDebugCode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Workaround for regenerated bytecode. Created 4 years, 6 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/debug/liveedit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/liveedit.cc
diff --git a/src/debug/liveedit.cc b/src/debug/liveedit.cc
index e9c373e95b6bd1bb6d20567c3012a7b4c8d156c5..39db3dbcca572b7c04d9173aaf21aef7ac5ec7ab 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -621,11 +621,9 @@ void FunctionInfoWrapper::SetInitialProperties(Handle<String> name,
this->SetSmiValueField(kParentIndexOffset_, parent_index);
}
-
-void FunctionInfoWrapper::SetFunctionCode(Handle<Code> function_code,
+void FunctionInfoWrapper::SetFunctionCode(Handle<AbstractCode> function_code,
Handle<HeapObject> code_scope_info) {
// CompileForLiveEdit must deliver full-codegen code.
- DCHECK(function_code->kind() == Code::FUNCTION);
Handle<JSValue> code_wrapper = WrapInJSValue(function_code);
this->SetField(kCodeOffset_, code_wrapper);
@@ -640,13 +638,12 @@ void FunctionInfoWrapper::SetSharedFunctionInfo(
this->SetField(kSharedFunctionInfoOffset_, info_holder);
}
-
-Handle<Code> FunctionInfoWrapper::GetFunctionCode() {
+Handle<AbstractCode> FunctionInfoWrapper::GetFunctionCode() {
Handle<Object> element = this->GetField(kCodeOffset_);
Handle<JSValue> value_wrapper = Handle<JSValue>::cast(element);
Handle<Object> raw_result = UnwrapJSValue(value_wrapper);
- CHECK(raw_result->IsCode());
- return Handle<Code>::cast(raw_result);
+ CHECK(raw_result->IsAbstractCode());
+ return Handle<AbstractCode>::cast(raw_result);
}
MaybeHandle<TypeFeedbackMetadata> FunctionInfoWrapper::GetFeedbackMetadata() {
@@ -1012,16 +1009,17 @@ void LiveEdit::ReplaceFunctionCode(
bool feedback_metadata_changed = false;
if (shared_info->is_compiled()) {
- Handle<Code> new_code = compile_info_wrapper.GetFunctionCode();
- Handle<Code> old_code(shared_info->code());
+ Handle<AbstractCode> new_code = compile_info_wrapper.GetFunctionCode();
if (shared_info->HasBytecodeArray()) {
- // The old code is interpreted. If we clear the bytecode array, the
- // interpreter entry trampoline will self-heal and go to compiled code.
+ DCHECK(new_code->IsBytecodeArray());
+ // The old code is interpreted, the new code must be interpreted as well.
shared_info->ClearBytecodeArray();
- shared_info->ReplaceCode(*new_code);
+ shared_info->set_bytecode_array(BytecodeArray::cast(*new_code));
} else {
+ Handle<Code> old_code(shared_info->code());
DCHECK(old_code->kind() == Code::FUNCTION);
- ReplaceCodeObject(old_code, new_code);
+ DCHECK(new_code->kind() == AbstractCode::FUNCTION);
+ ReplaceCodeObject(old_code, Handle<Code>::cast(new_code));
}
if (shared_info->HasDebugInfo()) {
// Existing break points will be re-applied. Reset the debug info here.
@@ -2002,7 +2000,7 @@ void LiveEditFunctionTracker::FunctionDone(Handle<SharedFunctionInfo> shared,
FunctionInfoWrapper info = FunctionInfoWrapper::cast(
*JSReceiver::GetElement(isolate_, result_, current_parent_index_)
.ToHandleChecked());
- info.SetFunctionCode(Handle<Code>(shared->code()),
+ info.SetFunctionCode(Handle<AbstractCode>(shared->abstract_code()),
Handle<HeapObject>(shared->scope_info()));
info.SetSharedFunctionInfo(shared);
« no previous file with comments | « src/debug/liveedit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698