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

Unified Diff: runtime/vm/object.cc

Issue 1418833004: VM: Service isolate under precompilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 93c5502dc51f97242fe8ab8c9d35585d075c02b6..1dfdcdf3877d16c956c79c8dd6fd40d30e3f843b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -13425,24 +13425,35 @@ bool Code::FindRawCodeVisitor::FindObject(RawObject* raw_obj) const {
}
+bool Code::SlowFindRawCodeVisitor::FindObject(RawObject* raw_obj) const {
+ return RawCode::ContainsPC(raw_obj, pc_);
+}
+
+
RawCode* Code::LookupCodeInIsolate(Isolate* isolate, uword pc) {
ASSERT((isolate == Isolate::Current()) || (isolate == Dart::vm_isolate()));
+ if (isolate->heap() == NULL) {
+ return Code::null();
+ }
NoSafepointScope no_safepoint;
- FindRawCodeVisitor visitor(pc);
- RawInstructions* instr;
+ // TODO(johnmccutchan): Make lookup without a back pointer faster and use for
+ // both cases.
if (Dart::IsRunningPrecompiledCode()) {
- // TODO(johnmccutchan): Make code lookup work when running precompiled.
- UNIMPLEMENTED();
+ SlowFindRawCodeVisitor visitor(pc);
+ RawObject* needle = isolate->heap()->FindOldObject(&visitor);
+ if (needle != Code::null()) {
+ return static_cast<RawCode*>(needle);
+ }
return Code::null();
- }
- if (isolate->heap() == NULL) {
+ } else {
+ FindRawCodeVisitor visitor(pc);
+ RawInstructions* instr;
+ instr = isolate->heap()->FindObjectInCodeSpace(&visitor);
+ if (instr != Instructions::null()) {
+ return Instructions::Handle(instr).code();
+ }
return Code::null();
}
- instr = isolate->heap()->FindObjectInCodeSpace(&visitor);
- if (instr != Instructions::null()) {
- return Instructions::Handle(instr).code();
- }
- return Code::null();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698