Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 6803010: X64: Allow the type recording binary op stub to create heapnumber results. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Copied code from ARM. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, &not_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(&not_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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698