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

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: typo 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5088075dfa46b3d75602c5e8e52b9fe41e5f50fa..0a5790991d4255f4d56ad3fa42c7516a1950ac69 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -13360,24 +13360,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();
}
« runtime/include/dart_api.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698