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

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

Issue 1077793003: Remove redundant variable descriptors from optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/flow_graph_compiler.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 (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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } else { 453 } else {
454 column_number_ = -1; 454 column_number_ = -1;
455 } 455 }
456 } 456 }
457 return column_number_; 457 return column_number_;
458 } 458 }
459 459
460 460
461 void ActivationFrame::GetVarDescriptors() { 461 void ActivationFrame::GetVarDescriptors() {
462 if (var_descriptors_.IsNull()) { 462 if (var_descriptors_.IsNull()) {
463 var_descriptors_ = code().var_descriptors(); 463 if (code().is_optimized()) {
464 Compiler::EnsureUnoptimizedCode(Thread::Current(), function());
465 }
466 var_descriptors_ = code().is_optimized()
467 ? Code::Handle(function().unoptimized_code()).var_descriptors()
468 : code().var_descriptors();
srdjan 2015/04/15 16:25:45 Could this be just : var_descriptors = Code::Handl
Florian Schneider 2015/04/16 11:37:18 Yes. I'll simplify it. I think it is fine to have
464 ASSERT(!var_descriptors_.IsNull()); 469 ASSERT(!var_descriptors_.IsNull());
465 } 470 }
466 } 471 }
467 472
468 473
469 bool ActivationFrame::IsDebuggable() const { 474 bool ActivationFrame::IsDebuggable() const {
470 return Debugger::IsDebuggable(function()); 475 return Debugger::IsDebuggable(function());
471 } 476 }
472 477
473 478
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 652 }
648 vars_initialized_ = true; 653 vars_initialized_ = true;
649 } 654 }
650 655
651 656
652 intptr_t ActivationFrame::NumLocalVariables() { 657 intptr_t ActivationFrame::NumLocalVariables() {
653 GetDescIndices(); 658 GetDescIndices();
654 return desc_indices_.length(); 659 return desc_indices_.length();
655 } 660 }
656 661
657 // TODO(hausner): Handle captured variables. 662
658 RawObject* ActivationFrame::GetLocalVar(intptr_t slot_index) { 663 RawObject* ActivationFrame::GetLocalVar(intptr_t slot_index) {
659 if (deopt_frame_.IsNull()) { 664 if (deopt_frame_.IsNull()) {
660 uword var_address = fp() + slot_index * kWordSize; 665 uword var_address = fp() + slot_index * kWordSize;
661 return reinterpret_cast<RawObject*>( 666 return reinterpret_cast<RawObject*>(
662 *reinterpret_cast<uword*>(var_address)); 667 *reinterpret_cast<uword*>(var_address));
663 } else { 668 } else {
664 return deopt_frame_.At(deopt_frame_offset_ + slot_index); 669 return deopt_frame_.At(deopt_frame_offset_ + slot_index);
665 } 670 }
666 } 671 }
667 672
(...skipping 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 } 2641 }
2637 2642
2638 2643
2639 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 2644 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
2640 ASSERT(bpt->next() == NULL); 2645 ASSERT(bpt->next() == NULL);
2641 bpt->set_next(code_breakpoints_); 2646 bpt->set_next(code_breakpoints_);
2642 code_breakpoints_ = bpt; 2647 code_breakpoints_ = bpt;
2643 } 2648 }
2644 2649
2645 } // namespace dart 2650 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.h ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698