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

Unified Diff: src/factory.cc

Issue 1703453002: [interpreter, debugger] support debug breaks via bytecode array copy (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 22f6b0975498b975b53f0bc9a58cefd2cea1be1b..15ddb5ff438c66ee4045ac3dd2facd7ffbf426a6 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1481,6 +1481,12 @@ Handle<Code> Factory::CopyCode(Handle<Code> code, Vector<byte> reloc_info) {
Code);
}
+Handle<BytecodeArray> Factory::CopyBytecodeArray(
+ Handle<BytecodeArray> bytecode_array) {
+ CALL_HEAP_FUNCTION(isolate(),
+ isolate()->heap()->CopyBytecodeArray(*bytecode_array),
+ BytecodeArray);
+}
Handle<JSObject> Factory::NewJSObject(Handle<JSFunction> constructor,
PretenureFlag pretenure) {
@@ -2129,7 +2135,7 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
share->set_instance_class_name(*Object_string());
share->set_function_data(*undefined_value(), SKIP_WRITE_BARRIER);
share->set_script(*undefined_value(), SKIP_WRITE_BARRIER);
- share->set_debug_info(*undefined_value(), SKIP_WRITE_BARRIER);
+ share->set_debug_info(DebugInfo::uninitialized(), SKIP_WRITE_BARRIER);
share->set_inferred_name(*empty_string(), SKIP_WRITE_BARRIER);
StaticFeedbackVectorSpec empty_spec;
Handle<TypeFeedbackMetadata> feedback_metadata =
@@ -2248,7 +2254,10 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
debug_info->set_shared(*shared);
if (shared->HasBytecodeArray()) {
- debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array()));
+ // Create a copy for debugging.
+ Handle<BytecodeArray> original(shared->bytecode_array(), isolate());
+ Handle<BytecodeArray> copy = CopyBytecodeArray(original);
+ debug_info->set_abstract_code(AbstractCode::cast(*copy));
} else {
debug_info->set_abstract_code(AbstractCode::cast(shared->code()));
}
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698