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

Unified Diff: runtime/vm/object.cc

Issue 608913002: Track references to allocation stubs via static_calls_table, instead of keeping two referencers ali… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 40735)
+++ 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);
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698