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

Unified Diff: src/debug/liveedit.cc

Issue 2077363002: [liveedit] simplify source position recalculation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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 | « no previous file | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/liveedit.cc
diff --git a/src/debug/liveedit.cc b/src/debug/liveedit.cc
index b28ae9a41c669711a5155e7ee8575c915997ce53..aa675374b51d88d34e8a0441c1c4b2fd98cb30f1 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -1226,18 +1226,13 @@ Handle<Code> PatchPositionsInCode(Handle<Code> code,
}
Vector<byte> buffer = buffer_writer.GetResult();
+ Handle<ByteArray> reloc_info =
+ isolate->factory()->NewByteArray(buffer.length(), TENURED);
- if (buffer.length() == code->relocation_size()) {
- // Simply patch relocation area of code.
- MemCopy(code->relocation_start(), buffer.start(), buffer.length());
- return code;
- } else {
- // Relocation info section now has different size. We cannot simply
- // rewrite it inside code object. Instead we have to create a new
- // code object.
- Handle<Code> result(isolate->factory()->CopyCode(code, buffer));
- return result;
- }
+ DisallowHeapAllocation no_gc;
+ code->set_relocation_info(*reloc_info);
+ CopyBytes(code->relocation_start(), buffer.start(), buffer.length());
+ return code;
}
void PatchPositionsInBytecodeArray(Handle<BytecodeArray> bytecode,
« no previous file with comments | « no previous file | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698