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

Unified Diff: src/factory.cc

Issue 2238893002: [debugger] separate break point info from code instrumentation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 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/debug.cc ('k') | src/objects.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 b4d9de0fd157da66fe3400738ca44a73e4759ffc..571cd3ff9b66395a82411de91de0304353b6e16a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2222,26 +2222,21 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
Handle<FixedArray> break_points(
NewFixedArray(DebugInfo::kEstimatedNofBreakPointsInFunction));
+ // Make a copy of the bytecode array if available.
+ Handle<Object> maybe_debug_bytecode_array = undefined_value();
+ if (shared->HasBytecodeArray()) {
+ Handle<BytecodeArray> original(shared->bytecode_array());
+ maybe_debug_bytecode_array = CopyBytecodeArray(original);
+ }
+
// Create and set up the debug info object. Debug info contains function, a
// copy of the original code, the executing code and initial fixed array for
// active break points.
Handle<DebugInfo> debug_info =
Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
debug_info->set_shared(*shared);
- if (shared->HasBytecodeArray()) {
- // We need to create a copy, but delay since this may cause heap
- // verification.
- debug_info->set_abstract_code(AbstractCode::cast(shared->bytecode_array()));
- } else {
- debug_info->set_abstract_code(AbstractCode::cast(shared->code()));
- }
+ debug_info->set_debug_bytecode_array(*maybe_debug_bytecode_array);
debug_info->set_break_points(*break_points);
- if (shared->HasBytecodeArray()) {
- // Create a copy for debugging.
- Handle<BytecodeArray> original(shared->bytecode_array());
- Handle<BytecodeArray> copy = CopyBytecodeArray(original);
- debug_info->set_abstract_code(AbstractCode::cast(*copy));
- }
// Link debug info to function.
shared->set_debug_info(*debug_info);
« no previous file with comments | « src/debug/debug.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698