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)); |