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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 case Token::SHR: | 1415 case Token::SHR: |
1416 __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION); | 1416 __ InvokeBuiltin(Builtins::SHR, JUMP_FUNCTION); |
1417 break; | 1417 break; |
1418 default: | 1418 default: |
1419 UNREACHABLE(); | 1419 UNREACHABLE(); |
1420 } | 1420 } |
1421 } | 1421 } |
1422 | 1422 |
1423 | 1423 |
1424 void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { | 1424 void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
1425 Label not_smi; | 1425 Label call_runtime; |
| 1426 if (result_type_ == TRBinaryOpIC::UNINITIALIZED || |
| 1427 result_type_ == TRBinaryOpIC::SMI) { |
| 1428 // Only allow smi results. |
| 1429 GenerateSmiCode(masm, NULL, NO_HEAPNUMBER_RESULTS); |
| 1430 } else { |
| 1431 // Allow heap number result and don't make a transition if a heap number |
| 1432 // cannot be allocated. |
| 1433 GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS); |
| 1434 } |
1426 | 1435 |
1427 GenerateSmiCode(masm, ¬_smi, NO_HEAPNUMBER_RESULTS); | 1436 // Code falls through if the result is not returned as either a smi or heap |
| 1437 // number. |
| 1438 GenerateTypeTransition(masm); |
1428 | 1439 |
1429 __ bind(¬_smi); | 1440 __ bind(&call_runtime); |
1430 GenerateTypeTransition(masm); | 1441 GenerateCallRuntimeCode(masm); |
1431 } | 1442 } |
1432 | 1443 |
1433 | 1444 |
1434 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { | 1445 void TypeRecordingBinaryOpStub::GenerateStringStub(MacroAssembler* masm) { |
1435 ASSERT(operands_type_ == TRBinaryOpIC::STRING); | 1446 ASSERT(operands_type_ == TRBinaryOpIC::STRING); |
1436 ASSERT(op_ == Token::ADD); | 1447 ASSERT(op_ == Token::ADD); |
1437 GenerateStringAddCode(masm); | 1448 GenerateStringAddCode(masm); |
1438 // Try to add arguments as strings, otherwise, transition to the generic | 1449 // Try to add arguments as strings, otherwise, transition to the generic |
1439 // TRBinaryOpIC type. | 1450 // TRBinaryOpIC type. |
1440 GenerateTypeTransition(masm); | 1451 GenerateTypeTransition(masm); |
(...skipping 3682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5123 // Do a tail call to the rewritten stub. | 5134 // Do a tail call to the rewritten stub. |
5124 __ jmp(rdi); | 5135 __ jmp(rdi); |
5125 } | 5136 } |
5126 | 5137 |
5127 | 5138 |
5128 #undef __ | 5139 #undef __ |
5129 | 5140 |
5130 } } // namespace v8::internal | 5141 } } // namespace v8::internal |
5131 | 5142 |
5132 #endif // V8_TARGET_ARCH_X64 | 5143 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |