OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #if V8_TARGET_ARCH_PPC | 10 #if V8_TARGET_ARCH_PPC |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { | 169 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { |
170 SetRecordedAstId(ast_id); | 170 SetRecordedAstId(ast_id); |
171 rmode = RelocInfo::CODE_TARGET_WITH_ID; | 171 rmode = RelocInfo::CODE_TARGET_WITH_ID; |
172 } | 172 } |
173 AllowDeferredHandleDereference using_raw_address; | 173 AllowDeferredHandleDereference using_raw_address; |
174 Call(reinterpret_cast<Address>(code.location()), rmode, cond); | 174 Call(reinterpret_cast<Address>(code.location()), rmode, cond); |
175 DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start)); | 175 DCHECK_EQ(expected_size, SizeOfCodeGeneratedSince(&start)); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 void MacroAssembler::Ret(Condition cond) { | 179 void MacroAssembler::Drop(int count) { |
180 DCHECK(cond == al); | |
181 blr(); | |
182 } | |
183 | |
184 | |
185 void MacroAssembler::Drop(int count, Condition cond) { | |
186 DCHECK(cond == al); | |
187 if (count > 0) { | 180 if (count > 0) { |
188 Add(sp, sp, count * kPointerSize, r0); | 181 Add(sp, sp, count * kPointerSize, r0); |
189 } | 182 } |
190 } | 183 } |
191 | 184 |
192 | 185 |
193 void MacroAssembler::Ret(int drop, Condition cond) { | |
194 Drop(drop, cond); | |
195 Ret(cond); | |
196 } | |
197 | |
198 | |
199 void MacroAssembler::Call(Label* target) { b(target, SetLK); } | 186 void MacroAssembler::Call(Label* target) { b(target, SetLK); } |
200 | 187 |
201 | 188 |
202 void MacroAssembler::Push(Handle<Object> handle) { | 189 void MacroAssembler::Push(Handle<Object> handle) { |
203 mov(r0, Operand(handle)); | 190 mov(r0, Operand(handle)); |
204 push(r0); | 191 push(r0); |
205 } | 192 } |
206 | 193 |
207 | 194 |
208 void MacroAssembler::Move(Register dst, Handle<Object> value) { | 195 void MacroAssembler::Move(Register dst, Handle<Object> value) { |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 StoreP(scratch, MemOperand(ip)); | 477 StoreP(scratch, MemOperand(ip)); |
491 // Call stub on end of buffer. | 478 // Call stub on end of buffer. |
492 // Check for end of buffer. | 479 // Check for end of buffer. |
493 mov(r0, Operand(StoreBuffer::kStoreBufferOverflowBit)); | 480 mov(r0, Operand(StoreBuffer::kStoreBufferOverflowBit)); |
494 and_(r0, scratch, r0, SetRC); | 481 and_(r0, scratch, r0, SetRC); |
495 | 482 |
496 if (and_then == kFallThroughAtEnd) { | 483 if (and_then == kFallThroughAtEnd) { |
497 beq(&done, cr0); | 484 beq(&done, cr0); |
498 } else { | 485 } else { |
499 DCHECK(and_then == kReturnAtEnd); | 486 DCHECK(and_then == kReturnAtEnd); |
500 beq(&done, cr0); | 487 Ret(eq, cr0); |
501 } | 488 } |
502 mflr(r0); | 489 mflr(r0); |
503 push(r0); | 490 push(r0); |
504 StoreBufferOverflowStub store_buffer_overflow(isolate(), fp_mode); | 491 StoreBufferOverflowStub store_buffer_overflow(isolate(), fp_mode); |
505 CallStub(&store_buffer_overflow); | 492 CallStub(&store_buffer_overflow); |
506 pop(r0); | 493 pop(r0); |
507 mtlr(r0); | 494 mtlr(r0); |
508 bind(&done); | 495 bind(&done); |
509 if (and_then == kReturnAtEnd) { | 496 if (and_then == kReturnAtEnd) { |
510 Ret(); | 497 Ret(); |
(...skipping 4144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4655 } | 4642 } |
4656 if (mag.shift > 0) srawi(result, result, mag.shift); | 4643 if (mag.shift > 0) srawi(result, result, mag.shift); |
4657 ExtractBit(r0, dividend, 31); | 4644 ExtractBit(r0, dividend, 31); |
4658 add(result, result, r0); | 4645 add(result, result, r0); |
4659 } | 4646 } |
4660 | 4647 |
4661 } // namespace internal | 4648 } // namespace internal |
4662 } // namespace v8 | 4649 } // namespace v8 |
4663 | 4650 |
4664 #endif // V8_TARGET_ARCH_PPC | 4651 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |