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

Side by Side Diff: src/deoptimizer.cc

Issue 1618343002: [interpreter, debugger] abstraction for source position calculation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove bogus assertion 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 unified diff | Download patch
« no previous file with comments | « src/debug/debug-frames.cc ('k') | src/frames.h » ('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 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 bool has_construct_stub) { 2501 bool has_construct_stub) {
2502 FrameDescription* output_frame = deoptimizer->output_[frame_index]; 2502 FrameDescription* output_frame = deoptimizer->output_[frame_index];
2503 function_ = output_frame->GetFunction(); 2503 function_ = output_frame->GetFunction();
2504 context_ = reinterpret_cast<Object*>(output_frame->GetContext()); 2504 context_ = reinterpret_cast<Object*>(output_frame->GetContext());
2505 has_construct_stub_ = has_construct_stub; 2505 has_construct_stub_ = has_construct_stub;
2506 expression_count_ = output_frame->GetExpressionCount(); 2506 expression_count_ = output_frame->GetExpressionCount();
2507 expression_stack_ = new Object* [expression_count_]; 2507 expression_stack_ = new Object* [expression_count_];
2508 // Get the source position using the unoptimized code. 2508 // Get the source position using the unoptimized code.
2509 Address pc = reinterpret_cast<Address>(output_frame->GetPc()); 2509 Address pc = reinterpret_cast<Address>(output_frame->GetPc());
2510 Code* code = Code::cast(deoptimizer->isolate()->FindCodeObject(pc)); 2510 Code* code = Code::cast(deoptimizer->isolate()->FindCodeObject(pc));
2511 source_position_ = code->SourcePosition(pc); 2511 int offset = static_cast<int>(pc - code->instruction_start());
2512 source_position_ = code->SourcePosition(offset);
2512 2513
2513 for (int i = 0; i < expression_count_; i++) { 2514 for (int i = 0; i < expression_count_; i++) {
2514 Object* value = output_frame->GetExpression(i); 2515 Object* value = output_frame->GetExpression(i);
2515 // Replace materialization markers with the undefined value. 2516 // Replace materialization markers with the undefined value.
2516 if (value == deoptimizer->isolate()->heap()->arguments_marker()) { 2517 if (value == deoptimizer->isolate()->heap()->arguments_marker()) {
2517 value = deoptimizer->isolate()->heap()->undefined_value(); 2518 value = deoptimizer->isolate()->heap()->undefined_value();
2518 } 2519 }
2519 SetExpression(i, value); 2520 SetExpression(i, value);
2520 } 2521 }
2521 2522
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3710 DCHECK(value_info->IsMaterializedObject()); 3711 DCHECK(value_info->IsMaterializedObject());
3711 3712
3712 value_info->value_ = 3713 value_info->value_ =
3713 Handle<Object>(previously_materialized_objects->get(i), isolate_); 3714 Handle<Object>(previously_materialized_objects->get(i), isolate_);
3714 } 3715 }
3715 } 3716 }
3716 } 3717 }
3717 3718
3718 } // namespace internal 3719 } // namespace internal
3719 } // namespace v8 3720 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug-frames.cc ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698