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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 | 5355 |
5356 // Store result register while executing finally block. | 5356 // Store result register while executing finally block. |
5357 __ push(r4); | 5357 __ push(r4); |
5358 | 5358 |
5359 // Store pending message while executing finally block. | 5359 // Store pending message while executing finally block. |
5360 ExternalReference pending_message_obj = | 5360 ExternalReference pending_message_obj = |
5361 ExternalReference::address_of_pending_message_obj(isolate()); | 5361 ExternalReference::address_of_pending_message_obj(isolate()); |
5362 __ mov(ip, Operand(pending_message_obj)); | 5362 __ mov(ip, Operand(pending_message_obj)); |
5363 __ LoadP(r4, MemOperand(ip)); | 5363 __ LoadP(r4, MemOperand(ip)); |
5364 __ push(r4); | 5364 __ push(r4); |
| 5365 |
| 5366 ClearPendingMessage(); |
5365 } | 5367 } |
5366 | 5368 |
5367 | 5369 |
5368 void FullCodeGenerator::ExitFinallyBlock() { | 5370 void FullCodeGenerator::ExitFinallyBlock() { |
5369 DCHECK(!result_register().is(r4)); | 5371 DCHECK(!result_register().is(r4)); |
5370 // Restore pending message from stack. | 5372 // Restore pending message from stack. |
5371 __ pop(r4); | 5373 __ pop(r4); |
5372 ExternalReference pending_message_obj = | 5374 ExternalReference pending_message_obj = |
5373 ExternalReference::address_of_pending_message_obj(isolate()); | 5375 ExternalReference::address_of_pending_message_obj(isolate()); |
5374 __ mov(ip, Operand(pending_message_obj)); | 5376 __ mov(ip, Operand(pending_message_obj)); |
5375 __ StoreP(r4, MemOperand(ip)); | 5377 __ StoreP(r4, MemOperand(ip)); |
5376 | 5378 |
5377 // Restore result register from stack. | 5379 // Restore result register from stack. |
5378 __ pop(r4); | 5380 __ pop(r4); |
5379 | 5381 |
5380 // Uncook return address and return. | 5382 // Uncook return address and return. |
5381 __ pop(result_register()); | 5383 __ pop(result_register()); |
5382 __ SmiUntag(r4); | 5384 __ SmiUntag(r4); |
5383 __ mov(ip, Operand(masm_->CodeObject())); | 5385 __ mov(ip, Operand(masm_->CodeObject())); |
5384 __ add(ip, ip, r4); | 5386 __ add(ip, ip, r4); |
5385 __ mtctr(ip); | 5387 __ mtctr(ip); |
5386 __ bctr(); | 5388 __ bctr(); |
5387 } | 5389 } |
5388 | 5390 |
5389 | 5391 |
| 5392 void FullCodeGenerator::ClearPendingMessage() { |
| 5393 DCHECK(!result_register().is(r4)); |
| 5394 ExternalReference pending_message_obj = |
| 5395 ExternalReference::address_of_pending_message_obj(isolate()); |
| 5396 __ LoadRoot(r4, Heap::kTheHoleValueRootIndex); |
| 5397 __ mov(ip, Operand(pending_message_obj)); |
| 5398 __ StoreP(r4, MemOperand(ip)); |
| 5399 } |
| 5400 |
| 5401 |
5390 #undef __ | 5402 #undef __ |
5391 | 5403 |
5392 | 5404 |
5393 void BackEdgeTable::PatchAt(Code* unoptimized_code, Address pc, | 5405 void BackEdgeTable::PatchAt(Code* unoptimized_code, Address pc, |
5394 BackEdgeState target_state, | 5406 BackEdgeState target_state, |
5395 Code* replacement_code) { | 5407 Code* replacement_code) { |
5396 Address mov_address = Assembler::target_address_from_return_address(pc); | 5408 Address mov_address = Assembler::target_address_from_return_address(pc); |
5397 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; | 5409 Address cmp_address = mov_address - 2 * Assembler::kInstrSize; |
5398 CodePatcher patcher(cmp_address, 1); | 5410 CodePatcher patcher(cmp_address, 1); |
5399 | 5411 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5454 return ON_STACK_REPLACEMENT; | 5466 return ON_STACK_REPLACEMENT; |
5455 } | 5467 } |
5456 | 5468 |
5457 DCHECK(interrupt_address == | 5469 DCHECK(interrupt_address == |
5458 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5470 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5459 return OSR_AFTER_STACK_CHECK; | 5471 return OSR_AFTER_STACK_CHECK; |
5460 } | 5472 } |
5461 } | 5473 } |
5462 } // namespace v8::internal | 5474 } // namespace v8::internal |
5463 #endif // V8_TARGET_ARCH_PPC | 5475 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |