OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 | 2435 |
2436 void TypeRecordingBinaryOpStub::GenerateOptimisticSmiOperation( | 2436 void TypeRecordingBinaryOpStub::GenerateOptimisticSmiOperation( |
2437 MacroAssembler* masm) { | 2437 MacroAssembler* masm) { |
2438 Register left = r1; | 2438 Register left = r1; |
2439 Register right = r0; | 2439 Register right = r0; |
2440 | 2440 |
2441 ASSERT(right.is(r0)); | 2441 ASSERT(right.is(r0)); |
2442 | 2442 |
2443 switch (op_) { | 2443 switch (op_) { |
2444 case Token::ADD: | 2444 case Token::ADD: |
2445 __ add(right, left, Operand(right), SetCC); // Add optimistically. | 2445 __ add(right, left, Operand(right), SetCC); // Add optimistically. |
2446 __ Ret(vc); | 2446 __ Ret(vc); |
2447 __ sub(right, right, Operand(left)); // Revert optimistic add. | 2447 __ sub(right, right, Operand(left)); // Revert optimistic add. |
2448 break; | 2448 break; |
2449 case Token::SUB: | 2449 case Token::SUB: |
2450 __ sub(right, left, Operand(right), SetCC); // Subtract optimistically. | 2450 __ sub(right, left, Operand(right), SetCC); // Subtract optimistically. |
2451 __ Ret(vc); | 2451 __ Ret(vc); |
2452 __ sub(right, left, Operand(right)); // Revert optimistic subtract. | 2452 __ sub(right, left, Operand(right)); // Revert optimistic subtract. |
2453 break; | 2453 break; |
2454 default: | 2454 default: |
2455 UNREACHABLE(); | 2455 UNREACHABLE(); |
2456 } | 2456 } |
2457 } | 2457 } |
2458 | 2458 |
2459 | 2459 |
2460 void TypeRecordingBinaryOpStub::GenerateVFPOperation( | 2460 void TypeRecordingBinaryOpStub::GenerateVFPOperation( |
2461 MacroAssembler* masm) { | 2461 MacroAssembler* masm) { |
2462 switch (op_) { | 2462 switch (op_) { |
2463 case Token::ADD: | 2463 case Token::ADD: |
2464 __ vadd(d5, d6, d7); | 2464 __ vadd(d5, d6, d7); |
2465 break; | 2465 break; |
2466 case Token::SUB: | 2466 case Token::SUB: |
2467 __ vsub(d5, d6, d7); | 2467 __ vsub(d5, d6, d7); |
2468 break; | 2468 break; |
2469 default: | 2469 default: |
2470 UNREACHABLE(); | 2470 UNREACHABLE(); |
2471 } | 2471 } |
2472 | |
2473 } | 2472 } |
2474 | 2473 |
2475 | 2474 |
2476 // Generate the smi code. If the operation on smis are successful this return is | 2475 // Generate the smi code. If the operation on smis are successful this return is |
2477 // generated. If the result is not a smi and heap number allocation is not | 2476 // generated. If the result is not a smi and heap number allocation is not |
2478 // requested the code falls through. If number allocation is requested but a | 2477 // requested the code falls through. If number allocation is requested but a |
2479 // heap number cannot be allocated the code jumps to the lable gc_required. | 2478 // heap number cannot be allocated the code jumps to the lable gc_required. |
2480 void TypeRecordingBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, | 2479 void TypeRecordingBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, |
2481 Label* gc_required, | 2480 Label* gc_required, |
2482 SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { | 2481 SmiCodeGenerateHeapNumberResults allow_heapnumber_results) { |
(...skipping 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5656 __ pop(r1); | 5655 __ pop(r1); |
5657 __ Jump(r2); | 5656 __ Jump(r2); |
5658 } | 5657 } |
5659 | 5658 |
5660 | 5659 |
5661 #undef __ | 5660 #undef __ |
5662 | 5661 |
5663 } } // namespace v8::internal | 5662 } } // namespace v8::internal |
5664 | 5663 |
5665 #endif // V8_TARGET_ARCH_ARM | 5664 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |