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

Unified Diff: runtime/vm/stack_frame.cc

Issue 11694003: In unoptimized code use call for instanceof instead of inlined checks. This allows us to collect ty… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 12 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/stack_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
===================================================================
--- runtime/vm/stack_frame.cc (revision 16586)
+++ runtime/vm/stack_frame.cc (working copy)
@@ -178,6 +178,24 @@
}
+intptr_t StackFrame::GetTokenPos() const {
+ const Code& code = Code::Handle(LookupDartCode());
+ if (code.IsNull()) {
+ return -1; // Stub frames do not have token_pos.
+ }
+ const PcDescriptors& descriptors =
+ PcDescriptors::Handle(code.pc_descriptors());
+ ASSERT(!descriptors.IsNull());
+ for (int i = 0; i < descriptors.Length(); i++) {
+ if (static_cast<uword>(descriptors.PC(i)) == pc()) {
+ return descriptors.TokenPos(i);
+ }
+ }
+ return -1;
+}
+
+
+
bool StackFrame::IsValid() const {
if (IsEntryFrame() || IsExitFrame() || IsStubFrame()) {
return true;
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698