OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 7267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7278 case Token::SUB: __ fsubp(1); break; | 7278 case Token::SUB: __ fsubp(1); break; |
7279 case Token::MUL: __ fmulp(1); break; | 7279 case Token::MUL: __ fmulp(1); break; |
7280 case Token::DIV: __ fdivp(1); break; | 7280 case Token::DIV: __ fdivp(1); break; |
7281 default: UNREACHABLE(); | 7281 default: UNREACHABLE(); |
7282 } | 7282 } |
7283 __ fstp_d(FieldOperand(edx, HeapNumber::kValueOffset)); | 7283 __ fstp_d(FieldOperand(edx, HeapNumber::kValueOffset)); |
7284 } | 7284 } |
7285 __ mov(eax, edx); | 7285 __ mov(eax, edx); |
7286 GenerateReturn(masm); | 7286 GenerateReturn(masm); |
7287 | 7287 |
7288 if (HasArgumentsInRegisters()) { | 7288 if (arg_location == ARGS_IN_REGISTERS) { |
7289 __ bind(&after_alloc_failure); | 7289 __ bind(&after_alloc_failure); |
7290 __ mov(edx, eax); | 7290 __ mov(edx, eax); |
7291 __ mov(eax, ebx); | 7291 __ mov(eax, ebx); |
7292 __ jmp(slow); | 7292 __ jmp(slow); |
7293 } | 7293 } |
7294 } | 7294 } |
7295 case Token::BIT_OR: | 7295 case Token::BIT_OR: |
7296 case Token::BIT_AND: | 7296 case Token::BIT_AND: |
7297 case Token::BIT_XOR: | 7297 case Token::BIT_XOR: |
7298 case Token::SAR: | 7298 case Token::SAR: |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7563 } | 7563 } |
7564 | 7564 |
7565 | 7565 |
7566 void GenericBinaryOpStub::GenerateHeapResultAllocation(MacroAssembler* masm, | 7566 void GenericBinaryOpStub::GenerateHeapResultAllocation(MacroAssembler* masm, |
7567 Label* alloc_failure) { | 7567 Label* alloc_failure) { |
7568 Label skip_allocation; | 7568 Label skip_allocation; |
7569 OverwriteMode mode = mode_; | 7569 OverwriteMode mode = mode_; |
7570 if (HasArgumentsReversed()) { | 7570 if (HasArgumentsReversed()) { |
7571 if (mode == OVERWRITE_RIGHT) { | 7571 if (mode == OVERWRITE_RIGHT) { |
7572 mode = OVERWRITE_LEFT; | 7572 mode = OVERWRITE_LEFT; |
7573 } | 7573 } else if (mode == OVERWRITE_LEFT) { |
7574 else if (mode == OVERWRITE_LEFT) { | |
7575 mode = OVERWRITE_RIGHT; | 7574 mode = OVERWRITE_RIGHT; |
7576 } | 7575 } |
7577 } | 7576 } |
7578 switch (mode) { | 7577 switch (mode) { |
7579 case OVERWRITE_LEFT: { | 7578 case OVERWRITE_LEFT: { |
7580 // If the argument in edx is already an object, we skip the | 7579 // If the argument in edx is already an object, we skip the |
7581 // allocation of a heap number. | 7580 // allocation of a heap number. |
7582 __ test(edx, Immediate(kSmiTagMask)); | 7581 __ test(edx, Immediate(kSmiTagMask)); |
7583 __ j(not_zero, &skip_allocation, not_taken); | 7582 __ j(not_zero, &skip_allocation, not_taken); |
7584 // Allocate a heap number for the result. Keep eax and edx intact | 7583 // Allocate a heap number for the result. Keep eax and edx intact |
(...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9982 | 9981 |
9983 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 9982 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
9984 // tagged as a small integer. | 9983 // tagged as a small integer. |
9985 __ bind(&runtime); | 9984 __ bind(&runtime); |
9986 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 9985 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
9987 } | 9986 } |
9988 | 9987 |
9989 #undef __ | 9988 #undef __ |
9990 | 9989 |
9991 } } // namespace v8::internal | 9990 } } // namespace v8::internal |
OLD | NEW |