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

Side by Side Diff: src/deoptimizer.cc

Issue 1763783003: [Interpreter] Fixes translation from bailout id to code offset. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added comments Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/deoptimizer.h" 5 #include "src/deoptimizer.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2485 return isolate->factory()->undefined_value(); 2485 return isolate->factory()->undefined_value();
2486 } 2486 }
2487 } 2487 }
2488 return it->GetValue(); 2488 return it->GetValue();
2489 } 2489 }
2490 2490
2491 int ComputeSourcePosition(Handle<SharedFunctionInfo> shared, 2491 int ComputeSourcePosition(Handle<SharedFunctionInfo> shared,
2492 BailoutId node_id) { 2492 BailoutId node_id) {
2493 if (shared->HasBytecodeArray()) { 2493 if (shared->HasBytecodeArray()) {
2494 BytecodeArray* bytecodes = shared->bytecode_array(); 2494 BytecodeArray* bytecodes = shared->bytecode_array();
2495 return bytecodes->SourcePosition(node_id.ToInt()); 2495 // BailoutId points to the next bytecode in the bytecode aray. Subtract
2496 // 1 to get the end of current bytecode.
2497 return bytecodes->SourcePosition(node_id.ToInt() - 1);
2496 } else { 2498 } else {
2497 Code* non_optimized_code = shared->code(); 2499 Code* non_optimized_code = shared->code();
2498 FixedArray* raw_data = non_optimized_code->deoptimization_data(); 2500 FixedArray* raw_data = non_optimized_code->deoptimization_data();
2499 DeoptimizationOutputData* data = DeoptimizationOutputData::cast(raw_data); 2501 DeoptimizationOutputData* data = DeoptimizationOutputData::cast(raw_data);
2500 unsigned pc_and_state = Deoptimizer::GetOutputInfo(data, node_id, *shared); 2502 unsigned pc_and_state = Deoptimizer::GetOutputInfo(data, node_id, *shared);
2501 unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state); 2503 unsigned pc_offset = FullCodeGenerator::PcField::decode(pc_and_state);
2502 return non_optimized_code->SourcePosition(pc_offset); 2504 return non_optimized_code->SourcePosition(pc_offset);
2503 } 2505 }
2504 } 2506 }
2505 2507
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 CHECK(value_info->IsMaterializedObject()); 3740 CHECK(value_info->IsMaterializedObject());
3739 3741
3740 value_info->value_ = 3742 value_info->value_ =
3741 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3743 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3742 } 3744 }
3743 } 3745 }
3744 } 3746 }
3745 3747
3746 } // namespace internal 3748 } // namespace internal
3747 } // namespace v8 3749 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698