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

Unified Diff: vm/object.cc

Issue 10375059: Use a reserved stack local variable to store the Code object so that it can be looked up easily whe… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « vm/object.h ('k') | vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 7669)
+++ vm/object.cc (working copy)
@@ -6180,6 +6180,29 @@
}
+// Check if object matches find condition.
+bool Code::FindRawCodeVisitor::FindObject(RawObject* obj) {
+ return RawInstructions::ContainsPC(obj, pc_);
+}
+
+
+RawCode* Code::LookupCode(uword pc) {
+ Isolate* isolate = Isolate::Current();
+ NoGCScope no_gc;
+ FindRawCodeVisitor visitor(pc);
+ RawInstructions* instr;
+ instr = isolate->heap()->FindObjectInCodeSpace(&visitor);
+ if (instr != Instructions::null()) {
+ return instr->ptr()->code_;
+ }
+ instr = isolate->heap()->FindObjectInStubCodeSpace(&visitor);
+ if (instr != Instructions::null()) {
+ return instr->ptr()->code_;
+ }
+ return Code::null();
+}
+
+
intptr_t Code::GetTokenIndexOfPC(uword pc) const {
intptr_t token_index = -1;
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
@@ -9702,7 +9725,7 @@
const Array& code_array = Array::Handle(raw_ptr()->code_array_);
const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_);
for (intptr_t i = 0; i < frame_pcs.length(); i++) {
- code = StackFrame::LookupCode(isolate, frame_pcs[i]);
+ code = Code::LookupCode(frame_pcs[i]);
ASSERT(!code.IsNull());
function = code.function();
function_array.SetAt((index + i), function);
« no previous file with comments | « vm/object.h ('k') | vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698