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

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

Issue 54963002: JS allocations tracking for arm architecture (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 8e187a49f331ea25eb8881eb1b337473d425549a..9c5fd195f737c9f1df24c13c8699b30c85cdcb57 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -1732,6 +1732,10 @@ void MacroAssembler::Allocate(int object_size,
ldr(ip, MemOperand(topaddr, limit - top));
}
+ if (isolate()->heap_profiler()->is_tracking_allocations()) {
+ RecordObjectAllocation(isolate(), result, object_size);
+ }
+
if ((flags & DOUBLE_ALIGNMENT) != 0) {
// Align the next allocation. Storing the filler map without checking top is
// safe in new-space because the limit of the heap is aligned there.
@@ -1846,6 +1850,10 @@ void MacroAssembler::Allocate(Register object_size,
ldr(ip, MemOperand(topaddr, limit - top));
}
+ if (isolate()->heap_profiler()->is_tracking_allocations()) {
+ RecordObjectAllocation(isolate(), result, object_size);
+ }
+
if ((flags & DOUBLE_ALIGNMENT) != 0) {
// Align the next allocation. Storing the filler map without checking top is
// safe in new-space because the limit of the heap is aligned there.
@@ -3995,6 +4003,42 @@ void CodePatcher::EmitCondition(Condition cond) {
}
+void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
+ Register object,
+ Register object_size) {
+ FrameScope frame(this, StackFrame::EXIT);
+ PushSafepointRegisters();
+ PrepareCallCFunction(3, r0);
+ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
+ if (!object.is(r1)) {
+ mov(r1, object);
+ }
+ if (!object_size.is(r2)) {
+ mov(r2, object_size);
+ }
+ 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, r0);
+ mov(r0, Operand(ExternalReference::isolate_address(isolate)));
+ if (!object.is(r1)) {
+ mov(r1, object);
+ }
+ mov(r2, Operand(object_size));
+ CallCFunction(
+ ExternalReference::record_object_allocation_function(isolate), 3);
+ PopSafepointRegisters();
+}
+
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_ARM
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698