Index: runtime/vm/object.cc |
=================================================================== |
--- runtime/vm/object.cc (revision 40711) |
+++ runtime/vm/object.cc (working copy) |
@@ -3517,20 +3517,8 @@ |
} |
-void Class::SwitchAllocationStub() const { |
- const Code& alloc_stub = Code::Handle(allocation_stub()); |
- if (!alloc_stub.IsNull()) { |
- CodePatcher::PatchEntry(alloc_stub); |
- const Code& spare_alloc_stub = Code::Handle(spare_allocation_stub()); |
- if (spare_alloc_stub.IsNull()) { |
- StorePointer(&raw_ptr()->allocation_stub_, Code::null()); |
- } else { |
- ASSERT(CodePatcher::IsEntryPatched(spare_alloc_stub)); |
- CodePatcher::RestoreEntry(spare_alloc_stub); |
- StorePointer(&raw_ptr()->allocation_stub_, spare_alloc_stub.raw()); |
- } |
- StorePointer(&raw_ptr()->spare_allocation_stub_, alloc_stub.raw()); |
- } |
+void Class::DisableAllocationStub() const { |
+ StorePointer(&raw_ptr()->allocation_stub_, Code::null()); |
} |
@@ -11997,6 +11985,23 @@ |
} |
+void Code::SetStubCallTargetCodeAt(uword pc, const Code& code) const { |
+ const intptr_t i = BinarySearchInSCallTable(pc); |
+ ASSERT(i >= 0); |
+ const Array& array = |
+ Array::Handle(raw_ptr()->static_calls_target_table_); |
+#if defined(DEBUG) |
+ if (array.At(i + kSCallTableFunctionEntry) == Function::null()) { |
+ ASSERT(!code.IsNull() && Object::Handle(code.owner()).IsClass()); |
+ } else { |
+ ASSERT(code.IsNull() || |
+ (code.function() == array.At(i + kSCallTableFunctionEntry))); |
+ } |
+#endif |
+ array.SetAt(i + kSCallTableCodeEntry, code); |
+} |
+ |
+ |
void Code::Disassemble(DisassemblyFormatter* formatter) const { |
const bool fix_patch = CodePatcher::CodeIsPatchable(*this) && |
CodePatcher::IsEntryPatched(*this); |