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

Unified Diff: runtime/vm/stub_code.cc

Issue 1412733008: Switch profiler from isolates to threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/stub_code.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code.cc
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 7c8fe78127aa21da377f15a4d349287fe576d982..e9fffc249f241b02d82ac14957c99c7c3f7da2a7 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -79,7 +79,16 @@ void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {
}
+bool StubCode::HasBeenInitialized() {
+ // Use JumpToExceptionHandler and InvokeDart as canaries.
+ const StubEntry* entry_1 = StubCode::JumpToExceptionHandler_entry();
+ const StubEntry* entry_2 = StubCode::InvokeDartCode_entry();
+ return (entry_1 != NULL) && (entry_2 != NULL);
+}
+
+
bool StubCode::InInvocationStub(uword pc) {
+ ASSERT(HasBeenInitialized());
uword entry = StubCode::InvokeDartCode_entry()->EntryPoint();
uword size = StubCode::InvokeDartCodeSize();
return (pc >= entry) && (pc < (entry + size));
@@ -87,6 +96,7 @@ bool StubCode::InInvocationStub(uword pc) {
bool StubCode::InJumpToExceptionHandlerStub(uword pc) {
+ ASSERT(HasBeenInitialized());
uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint();
uword size = StubCode::JumpToExceptionHandlerSize();
return (pc >= entry) && (pc < (entry + size));
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698