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

Unified Diff: src/compiler/code-generator.cc

Issue 2109673003: Use source position table in turbofan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: drive-by fix for relocation info size reservation 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/compiler/code-generator.h ('k') | src/debug/debug-frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index f3886593b14b5fadd4ccc27be037f88222ce42f1..74c97dfc5387059974e9eb521cbbfd7e6ffe702b 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -52,7 +52,8 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
last_lazy_deopt_pc_(0),
jump_tables_(nullptr),
ools_(nullptr),
- osr_pc_offset_(-1) {
+ osr_pc_offset_(-1),
+ source_position_table_builder_(info->isolate(), zone()) {
for (int i = 0; i < code->InstructionBlockCount(); ++i) {
new (&labels_[i]) Label;
}
@@ -73,8 +74,8 @@ Handle<Code> CodeGenerator::GenerateCode() {
FrameScope frame_scope(masm(), StackFrame::MANUAL);
// Emit a code line info recording start event.
- PositionsRecorder* recorder = masm()->positions_recorder();
- LOG_CODE_EVENT(isolate(), CodeStartLinePosInfoRecordEvent(recorder));
+ LOG_CODE_EVENT(isolate(), CodeStartLinePosInfoRecordEvent(
+ &source_position_table_builder_));
// Place function entry hook if requested to do so.
if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
@@ -209,6 +210,9 @@ Handle<Code> CodeGenerator::GenerateCode() {
result->set_is_turbofanned(true);
result->set_stack_slots(frame()->GetTotalFrameSlotCount());
result->set_safepoint_table_offset(safepoints()->GetCodeOffset());
+ Handle<ByteArray> source_positions =
+ source_position_table_builder_.ToSourcePositionTable();
+ result->set_source_position_table(*source_positions);
// Emit exception handler table.
if (!handlers_.empty()) {
@@ -235,7 +239,7 @@ Handle<Code> CodeGenerator::GenerateCode() {
}
// Emit a code line info recording stop event.
- void* line_info = recorder->DetachJITHandlerData();
+ void* line_info = source_position_table_builder_.DetachJITHandlerData();
LOG_CODE_EVENT(isolate(), CodeEndLinePosInfoRecordEvent(
AbstractCode::cast(*result), line_info));
@@ -398,7 +402,8 @@ void CodeGenerator::AssembleSourcePosition(Instruction* instr) {
current_source_position_ = source_position;
if (source_position.IsUnknown()) return;
int code_pos = source_position.raw();
- masm()->positions_recorder()->RecordPosition(code_pos);
+ source_position_table_builder_.AddPosition(masm()->pc_offset(), code_pos,
+ false);
if (FLAG_code_comments) {
CompilationInfo* info = this->info();
if (!info->parse_info()) return;
« no previous file with comments | « src/compiler/code-generator.h ('k') | src/debug/debug-frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698