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

Unified Diff: runtime/vm/stub_code_arm64.cc

Issue 557913002: Allow invalidation and recompilation of instance allocation stubs. Requested in order to implement… (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/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm64.cc
===================================================================
--- runtime/vm/stub_code_arm64.cc (revision 40156)
+++ runtime/vm/stub_code_arm64.cc (working copy)
@@ -418,6 +418,24 @@
}
+// Called from object allocate instruction when the allocation stub has been
+// disabled.
+void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
+ __ EnterStubFrame();
+ // Setup space on stack for return value.
+ __ PushObject(Object::null_object(), PP);
+ __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
+ // Get Code object result.
+ __ Pop(R0);
+ // Remove the stub frame.
+ __ LeaveStubFrame();
+ // Jump to the dart function.
+ __ LoadFieldFromOffset(R0, R0, Code::instructions_offset(), kNoPP);
+ __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag, kNoPP);
+ __ br(R0);
+}
+
+
// Input parameters:
// R2: smi-tagged argument count, may be zero.
// FP[kParamEndSlotFromFp + 1]: last argument.
@@ -1113,8 +1131,8 @@
// Input parameters:
// LR : return address.
// SP + 0 : type arguments object (only if class is parameterized).
-void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
- const Class& cls) {
+uword StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+ const Class& cls) {
// The generated code is different if the class is parameterized.
const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
ASSERT(!is_cls_parameterized ||
@@ -1232,6 +1250,10 @@
// Restore the frame pointer.
__ LeaveStubFrame();
__ ret();
+ uword patch_code_pc_offset = assembler->CodeSize();
+ StubCode* stub_code = Isolate::Current()->stub_code();
+ __ BranchPatchable(&stub_code->FixAllocationStubTargetLabel());
+ return patch_code_pc_offset;
}
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698