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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 43693002: Correctly setup exit frame when calling into allocation tracker (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added AllowStubCallsScope Created 7 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 | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index a18ff0d274c75e14eac2701a06f5d93e1cf5e8af..f728dba39902ebf301e986daa8ce958834182ecb 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -4091,7 +4091,12 @@ void MacroAssembler::Allocate(int object_size,
LoadAllocationTopHelper(result, scratch, flags);
if (isolate()->heap_profiler()->is_tracking_allocations()) {
- RecordObjectAllocation(isolate(), result, object_size);
+ AllowStubCallsScope allow_stub_calls(this, true);
+ RecordObjectAllocationStub stub;
+ push(Immediate(object_size));
+ push(result);
+ CallStub(&stub);
+ Drop(2);
}
// Align the next allocation. Storing the filler map without checking top is
@@ -4174,7 +4179,12 @@ void MacroAssembler::Allocate(Register object_size,
LoadAllocationTopHelper(result, scratch, flags);
if (isolate()->heap_profiler()->is_tracking_allocations()) {
- RecordObjectAllocation(isolate(), result, object_size);
+ AllowStubCallsScope allow_stub_calls(this, true);
+ RecordObjectAllocationStub stub;
+ push(object_size);
+ push(result);
+ CallStub(&stub);
+ Drop(2);
}
// Align the next allocation. Storing the filler map without checking top is
@@ -4937,38 +4947,6 @@ void MacroAssembler::TestJSArrayForAllocationMemento(
}
-void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
- Register object,
- Register object_size) {
- FrameScope frame(this, StackFrame::EXIT);
- PushSafepointRegisters();
- PrepareCallCFunction(3);
- // In case object is rdx
- movq(kScratchRegister, object);
- movq(arg_reg_3, object_size);
- movq(arg_reg_2, kScratchRegister);
- movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
- CallCFunction(
- ExternalReference::record_object_allocation_function(isolate), 3);
- PopSafepointRegisters();
-}
-
-
-void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
- Register object,
- int object_size) {
- FrameScope frame(this, StackFrame::EXIT);
- PushSafepointRegisters();
- PrepareCallCFunction(3);
- movq(arg_reg_2, object);
- movq(arg_reg_3, Immediate(object_size));
- movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
- CallCFunction(
- ExternalReference::record_object_allocation_function(isolate), 3);
- PopSafepointRegisters();
-}
-
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_X64
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698