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

Unified Diff: src/factory.cc

Issue 1861963003: Delay copying abstract code to avoid failing in the heap verifier (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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 98361d1716a5f4094b87d656e5814c1840f94317..99f80ed37b04624790c4cbdf0087dc73fea7ca7a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2239,14 +2239,19 @@ Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
Handle<DebugInfo>::cast(NewStruct(DEBUG_INFO_TYPE));
debug_info->set_shared(*shared);
if (shared->HasBytecodeArray()) {
- // 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));
+ // 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_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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698