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

Unified Diff: runtime/vm/debugger.cc

Issue 9475031: Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 4655)
+++ runtime/vm/debugger.cc (working copy)
@@ -32,7 +32,8 @@
line_number_(-1),
is_patched_(false),
next_(NULL) {
- Code& code = Code::Handle(func.code());
+ ASSERT(!func.HasOptimizedCode());
+ Code& code = Code::Handle(func.unoptimized_code());
ASSERT(!code.IsNull()); // Function must be compiled.
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
ASSERT(pc_desc_index < desc.Length());
@@ -89,7 +90,8 @@
ASSERT(Isolate::Current() != NULL);
CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
ASSERT(code_index_table != NULL);
- function_ = code_index_table->LookupFunction(pc_);
+ const Code& code = Code::Handle(code_index_table->LookupCode(pc_));
+ function_ = code.function();
}
return function_;
}
@@ -138,7 +140,8 @@
intptr_t ActivationFrame::TokenIndex() {
if (token_index_ < 0) {
const Function& func = DartFunction();
- Code& code = Code::Handle(func.code());
+ ASSERT(!func.HasOptimizedCode());
+ Code& code = Code::Handle(func.unoptimized_code());
ASSERT(!code.IsNull());
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
for (int i = 0; i < desc.Length(); i++) {
@@ -166,7 +169,8 @@
void ActivationFrame::GetDescIndices() {
if (var_descriptors_ == NULL) {
- const Code& code = Code::Handle(DartFunction().code());
+ ASSERT(!DartFunction().HasOptimizedCode());
+ const Code& code = Code::Handle(DartFunction().unoptimized_code());
var_descriptors_ =
&LocalVarDescriptors::ZoneHandle(code.var_descriptors());
GrowableArray<String*> var_names(8);
@@ -420,7 +424,8 @@
return;
}
}
- Code& code = Code::Handle(target_function.code());
+ ASSERT(!target_function.HasOptimizedCode());
+ Code& code = Code::Handle(target_function.unoptimized_code());
ASSERT(!code.IsNull());
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
for (int i = 0; i < desc.Length(); i++) {
@@ -458,7 +463,8 @@
return NULL;
}
}
- Code& code = Code::Handle(target_function.code());
+ ASSERT(!target_function.HasOptimizedCode());
+ Code& code = Code::Handle(target_function.unoptimized_code());
ASSERT(!code.IsNull());
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
for (int i = 0; i < desc.Length(); i++) {
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698