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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 11280276: ARM: make MacroAssembler::LoadRoot emit exactly one instruction when in predictable code size scope. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix long lines and sync comments. Created 8 years 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/full-codegen-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 __ cmp(r5, Operand(0)); 141 __ cmp(r5, Operand(0));
142 __ b(eq, &ok); 142 __ b(eq, &ok);
143 int receiver_offset = scope()->num_parameters() * kPointerSize; 143 int receiver_offset = scope()->num_parameters() * kPointerSize;
144 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 144 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
145 __ str(r2, MemOperand(sp, receiver_offset)); 145 __ str(r2, MemOperand(sp, receiver_offset));
146 __ bind(&ok); 146 __ bind(&ok);
147 } 147 }
148 148
149 149
150 info()->set_prologue_offset(masm_->pc_offset()); 150 info()->set_prologue_offset(masm_->pc_offset());
151 // The following three instructions must remain together and unmodified for 151 {
152 // code aging to work properly. 152 PredictableCodeSizeScope predictible_code_size_scope(
153 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); 153 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
154 // Add unused load of ip to ensure prologue sequence is identical for 154 // The following three instructions must remain together and unmodified
155 // full-codegen and lithium-codegen. 155 // for code aging to work properly.
156 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 156 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
157 __ add(fp, sp, Operand(2 * kPointerSize)); // Adjust FP to point to saved FP. 157 // Load undefined value here, so the value is ready for the loop
158 // below.
159 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
160 // Adjust FP to point to saved FP.
161 __ add(fp, sp, Operand(2 * kPointerSize));
162 }
158 163
159 // Reserve space for the stack slots needed by the code. 164 // Reserve space for the stack slots needed by the code.
160 int slots = GetStackSlotCount(); 165 int slots = GetStackSlotCount();
161 if (slots > 0) { 166 if (slots > 0) {
162 if (FLAG_debug_code) { 167 if (FLAG_debug_code) {
163 __ mov(r0, Operand(slots)); 168 __ mov(r0, Operand(slots));
164 __ mov(r2, Operand(kSlotsZapValue)); 169 __ mov(r2, Operand(kSlotsZapValue));
165 Label loop; 170 Label loop;
166 __ bind(&loop); 171 __ bind(&loop);
167 __ push(r2); 172 __ push(r2);
(...skipping 5616 matching lines...) Expand 10 before | Expand all | Expand 10 after
5784 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5789 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5785 __ ldr(result, FieldMemOperand(scratch, 5790 __ ldr(result, FieldMemOperand(scratch,
5786 FixedArray::kHeaderSize - kPointerSize)); 5791 FixedArray::kHeaderSize - kPointerSize));
5787 __ bind(&done); 5792 __ bind(&done);
5788 } 5793 }
5789 5794
5790 5795
5791 #undef __ 5796 #undef __
5792 5797
5793 } } // namespace v8::internal 5798 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698