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

Side by Side Diff: runtime/vm/debugger.cc

Issue 11418046: First part of static call cleanup: store static call targets into code object, referenced by code-o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/debugger.h" 5 #include "vm/debugger.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 8
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 Code& code = Code::Handle( 1396 Code& code = Code::Handle(
1397 ResolveCompileInstanceCallTarget(isolate_, receiver)); 1397 ResolveCompileInstanceCallTarget(isolate_, receiver));
1398 if (!code.IsNull()) { 1398 if (!code.IsNull()) {
1399 Function& callee = Function::Handle(code.function()); 1399 Function& callee = Function::Handle(code.function());
1400 if (IsDebuggable(callee)) { 1400 if (IsDebuggable(callee)) {
1401 func_to_instrument = callee.raw(); 1401 func_to_instrument = callee.raw();
1402 } 1402 }
1403 } 1403 }
1404 } else if (bpt->breakpoint_kind_ == PcDescriptors::kFuncCall) { 1404 } else if (bpt->breakpoint_kind_ == PcDescriptors::kFuncCall) {
1405 func_to_instrument = bpt->function(); 1405 func_to_instrument = bpt->function();
1406 Function& callee = Function::Handle(); 1406 const Function& callee =
1407 uword target; 1407 Function::Handle(Code::GetStaticCallTargetAt(bpt->pc_));
1408 CodePatcher::GetStaticCallAt(bpt->pc_, &callee, &target); 1408 ASSERT(!callee.IsNull());
1409 if (IsDebuggable(callee)) { 1409 if (IsDebuggable(callee)) {
1410 func_to_instrument = callee.raw(); 1410 func_to_instrument = callee.raw();
1411 } 1411 }
1412 } else { 1412 } else {
1413 ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn); 1413 ASSERT(bpt->breakpoint_kind_ == PcDescriptors::kReturn);
1414 // Treat like stepping out to caller. 1414 // Treat like stepping out to caller.
1415 if (stack_trace->Length() > 1) { 1415 if (stack_trace->Length() > 1) {
1416 ActivationFrame* caller_frame = stack_trace->ActivationFrameAt(1); 1416 ActivationFrame* caller_frame = stack_trace->ActivationFrameAt(1);
1417 func_to_instrument = caller_frame->DartFunction().raw(); 1417 func_to_instrument = caller_frame->DartFunction().raw();
1418 } 1418 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } 1616 }
1617 1617
1618 1618
1619 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1619 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1620 ASSERT(bpt->next() == NULL); 1620 ASSERT(bpt->next() == NULL);
1621 bpt->set_next(code_breakpoints_); 1621 bpt->set_next(code_breakpoints_);
1622 code_breakpoints_ = bpt; 1622 code_breakpoints_ = bpt;
1623 } 1623 }
1624 1624
1625 } // namespace dart 1625 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698