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

Unified Diff: src/debug/liveedit.cc

Issue 2248673002: Avoid accessing Isolate in source position logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/crankshaft/x87/lithium-codegen-x87.cc ('k') | src/full-codegen/full-codegen.h » ('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 accd547d003e4bf1bb210d5bbaa7d77074cae2c1..b51bb1a1c4c78e2c9a915fec270091ecd8d5a6a9 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -1102,13 +1102,13 @@ static int TranslatePosition(int original_position,
return original_position + position_diff;
}
-Handle<ByteArray> TranslateSourcePositionTable(
- Handle<ByteArray> source_position_table,
- Handle<JSArray> position_change_array) {
- Isolate* isolate = source_position_table->GetIsolate();
+void TranslateSourcePositionTable(Handle<AbstractCode> code,
+ Handle<JSArray> position_change_array) {
+ Isolate* isolate = code->GetIsolate();
Zone zone(isolate->allocator());
- SourcePositionTableBuilder builder(isolate, &zone);
+ SourcePositionTableBuilder builder(&zone);
+ Handle<ByteArray> source_position_table(code->source_position_table());
for (SourcePositionTableIterator iterator(*source_position_table);
!iterator.done(); iterator.Advance()) {
int position = iterator.source_position();
@@ -1117,7 +1117,9 @@ Handle<ByteArray> TranslateSourcePositionTable(
iterator.is_statement());
}
- return builder.ToSourcePositionTable();
+ Handle<ByteArray> new_source_position_table(
+ builder.ToSourcePositionTable(isolate, code));
+ code->set_source_position_table(*new_source_position_table);
}
} // namespace
@@ -1139,17 +1141,14 @@ void LiveEdit::PatchFunctionPositions(Handle<JSArray> shared_info_array,
info->set_function_token_position(new_function_token_pos);
if (info->HasBytecodeArray()) {
- Handle<ByteArray> new_source_position_table = TranslateSourcePositionTable(
- Handle<ByteArray>(info->bytecode_array()->source_position_table()),
+ TranslateSourcePositionTable(
+ Handle<AbstractCode>(AbstractCode::cast(info->bytecode_array())),
position_change_array);
- info->bytecode_array()->set_source_position_table(
- *new_source_position_table);
}
if (info->code()->kind() == Code::FUNCTION) {
- Handle<ByteArray> new_source_position_table = TranslateSourcePositionTable(
- Handle<ByteArray>(info->code()->source_position_table()),
+ TranslateSourcePositionTable(
+ Handle<AbstractCode>(AbstractCode::cast(info->code())),
position_change_array);
- info->code()->set_source_position_table(*new_source_position_table);
}
if (info->HasDebugInfo()) {
// Existing break points will be re-applied. Reset the debug info here.
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698