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

Unified Diff: src/factory.cc

Issue 2096863003: [wasm] prototype for breakpoint support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@extend-script-functionality
Patch Set: 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/factory.h ('k') | src/frames.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 3c5f4161fd00f8c162a8c0c21903cceeb8e9260f..84817160c7ae2539ea61722c2ed1942378985bbc 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2238,28 +2238,34 @@ Handle<String> Factory::NumberToString(Handle<Object> number,
return js_string;
}
-
-Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
+Handle<DebugInfo> Factory::NewDebugInfo(Handle<AbstractCode> code) {
// Allocate initial fixed array for active break points before allocating the
// debug info object to avoid allocation while setting up the debug info
// object.
Handle<FixedArray> break_points(
NewFixedArray(DebugInfo::kEstimatedNofBreakPointsInFunction));
- // 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.
+ // Create and set up the debug info object.
Handle<DebugInfo> debug_info =
Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
- debug_info->set_shared(*shared);
+ debug_info->set_abstract_code(*code);
+ debug_info->set_break_points(*break_points);
+
+ return debug_info;
+}
+
+Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
+ AbstractCode* code;
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()));
+ code = AbstractCode::cast(shared->bytecode_array());
} else {
- debug_info->set_abstract_code(AbstractCode::cast(shared->code()));
+ code = AbstractCode::cast(shared->code());
}
- debug_info->set_break_points(*break_points);
+
+ Handle<DebugInfo> debug_info = NewDebugInfo(handle(code));
+ debug_info->set_shared(*shared);
if (shared->HasBytecodeArray()) {
// Create a copy for debugging.
Handle<BytecodeArray> original(shared->bytecode_array());
« no previous file with comments | « src/factory.h ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698