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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 // immediately below so this use of ip does not cause difference with 1725 // immediately below so this use of ip does not cause difference with
1726 // respect to register content between debug and release mode. 1726 // respect to register content between debug and release mode.
1727 ldr(ip, MemOperand(topaddr)); 1727 ldr(ip, MemOperand(topaddr));
1728 cmp(result, ip); 1728 cmp(result, ip);
1729 Check(eq, kUnexpectedAllocationTop); 1729 Check(eq, kUnexpectedAllocationTop);
1730 } 1730 }
1731 // Load allocation limit into ip. Result already contains allocation top. 1731 // Load allocation limit into ip. Result already contains allocation top.
1732 ldr(ip, MemOperand(topaddr, limit - top)); 1732 ldr(ip, MemOperand(topaddr, limit - top));
1733 } 1733 }
1734 1734
1735 if (isolate()->heap_profiler()->is_tracking_allocations()) {
1736 RecordObjectAllocation(isolate(), result, object_size);
1737 }
1738
1735 if ((flags & DOUBLE_ALIGNMENT) != 0) { 1739 if ((flags & DOUBLE_ALIGNMENT) != 0) {
1736 // Align the next allocation. Storing the filler map without checking top is 1740 // Align the next allocation. Storing the filler map without checking top is
1737 // safe in new-space because the limit of the heap is aligned there. 1741 // safe in new-space because the limit of the heap is aligned there.
1738 ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0); 1742 ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0);
1739 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment); 1743 STATIC_ASSERT(kPointerAlignment * 2 == kDoubleAlignment);
1740 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); 1744 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC);
1741 Label aligned; 1745 Label aligned;
1742 b(eq, &aligned); 1746 b(eq, &aligned);
1743 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { 1747 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
1744 cmp(result, Operand(ip)); 1748 cmp(result, Operand(ip));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 // immediately below so this use of ip does not cause difference with 1843 // immediately below so this use of ip does not cause difference with
1840 // respect to register content between debug and release mode. 1844 // respect to register content between debug and release mode.
1841 ldr(ip, MemOperand(topaddr)); 1845 ldr(ip, MemOperand(topaddr));
1842 cmp(result, ip); 1846 cmp(result, ip);
1843 Check(eq, kUnexpectedAllocationTop); 1847 Check(eq, kUnexpectedAllocationTop);
1844 } 1848 }
1845 // Load allocation limit into ip. Result already contains allocation top. 1849 // Load allocation limit into ip. Result already contains allocation top.
1846 ldr(ip, MemOperand(topaddr, limit - top)); 1850 ldr(ip, MemOperand(topaddr, limit - top));
1847 } 1851 }
1848 1852
1853 if (isolate()->heap_profiler()->is_tracking_allocations()) {
1854 RecordObjectAllocation(isolate(), result, object_size);
1855 }
1856
1849 if ((flags & DOUBLE_ALIGNMENT) != 0) { 1857 if ((flags & DOUBLE_ALIGNMENT) != 0) {
1850 // Align the next allocation. Storing the filler map without checking top is 1858 // Align the next allocation. Storing the filler map without checking top is
1851 // safe in new-space because the limit of the heap is aligned there. 1859 // safe in new-space because the limit of the heap is aligned there.
1852 ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0); 1860 ASSERT((flags & PRETENURE_OLD_POINTER_SPACE) == 0);
1853 ASSERT(kPointerAlignment * 2 == kDoubleAlignment); 1861 ASSERT(kPointerAlignment * 2 == kDoubleAlignment);
1854 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC); 1862 and_(scratch2, result, Operand(kDoubleAlignmentMask), SetCC);
1855 Label aligned; 1863 Label aligned;
1856 b(eq, &aligned); 1864 b(eq, &aligned);
1857 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { 1865 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) {
1858 cmp(result, Operand(ip)); 1866 cmp(result, Operand(ip));
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 } 3996 }
3989 3997
3990 3998
3991 void CodePatcher::EmitCondition(Condition cond) { 3999 void CodePatcher::EmitCondition(Condition cond) {
3992 Instr instr = Assembler::instr_at(masm_.pc_); 4000 Instr instr = Assembler::instr_at(masm_.pc_);
3993 instr = (instr & ~kCondMask) | cond; 4001 instr = (instr & ~kCondMask) | cond;
3994 masm_.emit(instr); 4002 masm_.emit(instr);
3995 } 4003 }
3996 4004
3997 4005
4006 void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
4007 Register object,
4008 Register object_size) {
4009 FrameScope frame(this, StackFrame::EXIT);
4010 PushSafepointRegisters();
4011 PrepareCallCFunction(3, r0);
4012 mov(r0, Operand(ExternalReference::isolate_address(isolate)));
4013 if (!object.is(r1)) {
4014 mov(r1, object);
4015 }
4016 if (!object_size.is(r2)) {
4017 mov(r2, object_size);
4018 }
4019 CallCFunction(
4020 ExternalReference::record_object_allocation_function(isolate), 3);
4021 PopSafepointRegisters();
4022 }
4023
4024
4025 void MacroAssembler::RecordObjectAllocation(Isolate* isolate,
4026 Register object,
4027 int object_size) {
4028 FrameScope frame(this, StackFrame::EXIT);
4029 PushSafepointRegisters();
4030 PrepareCallCFunction(3, r0);
4031 mov(r0, Operand(ExternalReference::isolate_address(isolate)));
4032 if (!object.is(r1)) {
4033 mov(r1, object);
4034 }
4035 mov(r2, Operand(object_size));
4036 CallCFunction(
4037 ExternalReference::record_object_allocation_function(isolate), 3);
4038 PopSafepointRegisters();
4039 }
4040
4041
3998 } } // namespace v8::internal 4042 } } // namespace v8::internal
3999 4043
4000 #endif // V8_TARGET_ARCH_ARM 4044 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« 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