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

Unified Diff: src/heap/heap.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/heap/heap.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 4c280183c18c8fa8700eb0b23458dd8fa4cf713c..f7283fa1ce2810a752abfd5ec56dbdffa9f21aef 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3358,6 +3358,25 @@ AllocationResult Heap::CopyCode(Code* code) {
return new_code;
}
+AllocationResult Heap::CopyBytecodeArray(BytecodeArray* bytecode_array) {
+ int size = BytecodeArray::SizeFor(bytecode_array->length());
+ HeapObject* result = nullptr;
+ {
+ AllocationResult allocation = AllocateRaw(size, OLD_SPACE);
+ if (!allocation.To(&result)) return allocation;
+ }
+
+ result->set_map_no_write_barrier(bytecode_array_map());
+ BytecodeArray* copy = BytecodeArray::cast(result);
+ copy->set_length(bytecode_array->length());
+ copy->set_frame_size(bytecode_array->frame_size());
+ copy->set_parameter_count(bytecode_array->parameter_count());
+ copy->set_constant_pool(bytecode_array->constant_pool());
+ copy->set_handler_table(bytecode_array->handler_table());
+ copy->set_source_position_table(bytecode_array->source_position_table());
+ bytecode_array->CopyBytecodesTo(copy);
+ return copy;
+}
AllocationResult Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
// Allocate ByteArray before the Code object, so that we do not risk
« no previous file with comments | « src/heap/heap.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698