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

Unified Diff: runtime/vm/simulator_arm.cc

Issue 15692005: Fix a bug in optimized ARM code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm.cc
===================================================================
--- runtime/vm/simulator_arm.cc (revision 23168)
+++ runtime/vm/simulator_arm.cc (working copy)
@@ -114,11 +114,13 @@
bool GetFValue(char* desc, float* value);
bool GetDValue(char* desc, double* value);
- void PrintDartFrame(uword pc, uword fp, uword sp,
- const Function& function,
- intptr_t token_pos,
- bool is_optimized,
- bool is_inlined);
+ static intptr_t GetApproximateTokenIndex(const Code& code, uword pc);
+
+ static void PrintDartFrame(uword pc, uword fp, uword sp,
+ const Function& function,
+ intptr_t token_pos,
+ bool is_optimized,
+ bool is_inlined);
void PrintBacktrace();
// Set or delete a breakpoint. Returns true if successful.
@@ -262,6 +264,23 @@
}
+intptr_t SimulatorDebugger::GetApproximateTokenIndex(const Code& code,
+ uword pc) {
+ intptr_t token_pos = -1;
+ const PcDescriptors& descriptors =
+ PcDescriptors::Handle(code.pc_descriptors());
+ for (intptr_t i = 0; i < descriptors.Length(); i++) {
+ if (descriptors.PC(i) == pc) {
+ token_pos = descriptors.TokenPos(i);
+ break;
+ } else if ((token_pos <= 0) && (descriptors.PC(i) > pc)) {
+ token_pos = descriptors.TokenPos(i);
+ }
+ }
+ return token_pos;
+}
+
+
void SimulatorDebugger::PrintDartFrame(uword pc, uword fp, uword sp,
const Function& function,
intptr_t token_pos,
@@ -313,7 +332,8 @@
if (!it.Done()) {
PrintDartFrame(unoptimized_pc, frame->fp(), frame->sp(),
inlined_function,
- unoptimized_code.GetTokenIndexOfPC(unoptimized_pc),
+ GetApproximateTokenIndex(unoptimized_code,
+ unoptimized_pc),
true, true);
}
}
@@ -321,7 +341,7 @@
}
PrintDartFrame(frame->pc(), frame->fp(), frame->sp(),
function,
- code.GetTokenIndexOfPC(frame->pc()),
+ GetApproximateTokenIndex(code, frame->pc()),
code.is_optimized(), false);
} else {
OS::Print("pc=0x%"Px" fp=0x%"Px" sp=0x%"Px" %s frame\n",
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698