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

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

Issue 17468003: Use AST's type field and merge types for unary, binary & compare ICs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments Created 7 years, 6 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 | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 case Token::BIT_XOR: 1520 case Token::BIT_XOR:
1521 case Token::SAR: 1521 case Token::SAR:
1522 case Token::SHL: 1522 case Token::SHL:
1523 case Token::SHR: 1523 case Token::SHR:
1524 GenerateRegisterArgsPush(masm); 1524 GenerateRegisterArgsPush(masm);
1525 break; 1525 break;
1526 default: 1526 default:
1527 UNREACHABLE(); 1527 UNREACHABLE();
1528 } 1528 }
1529 1529
1530 if (op_ == Token::MOD && has_fixed_right_arg_) { 1530 if (op_ == Token::MOD && encoded_right_arg_.has_value) {
1531 // It is guaranteed that the value will fit into a Smi, because if it 1531 // It is guaranteed that the value will fit into a Smi, because if it
1532 // didn't, we wouldn't be here, see BinaryOp_Patch. 1532 // didn't, we wouldn't be here, see BinaryOp_Patch.
1533 __ cmp(eax, Immediate(Smi::FromInt(fixed_right_arg_value()))); 1533 __ cmp(eax, Immediate(Smi::FromInt(fixed_right_arg_value())));
1534 __ j(not_equal, &right_arg_changed); 1534 __ j(not_equal, &right_arg_changed);
1535 } 1535 }
1536 1536
1537 if (result_type_ == BinaryOpIC::UNINITIALIZED || 1537 if (result_type_ == BinaryOpIC::UNINITIALIZED ||
1538 result_type_ == BinaryOpIC::SMI) { 1538 result_type_ == BinaryOpIC::SMI) {
1539 BinaryOpStub_GenerateSmiCode( 1539 BinaryOpStub_GenerateSmiCode(
1540 masm, &call_runtime, NO_HEAPNUMBER_RESULTS, op_); 1540 masm, &call_runtime, NO_HEAPNUMBER_RESULTS, op_);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 } 1662 }
1663 if (right_type_ == BinaryOpIC::SMI) { 1663 if (right_type_ == BinaryOpIC::SMI) {
1664 __ JumpIfNotSmi(eax, &not_int32); 1664 __ JumpIfNotSmi(eax, &not_int32);
1665 } 1665 }
1666 FloatingPointHelper::LoadSSE2Operands(masm, &not_floats); 1666 FloatingPointHelper::LoadSSE2Operands(masm, &not_floats);
1667 FloatingPointHelper::CheckSSE2OperandIsInt32( 1667 FloatingPointHelper::CheckSSE2OperandIsInt32(
1668 masm, &not_int32, xmm0, ebx, ecx, xmm2); 1668 masm, &not_int32, xmm0, ebx, ecx, xmm2);
1669 FloatingPointHelper::CheckSSE2OperandIsInt32( 1669 FloatingPointHelper::CheckSSE2OperandIsInt32(
1670 masm, &not_int32, xmm1, edi, ecx, xmm2); 1670 masm, &not_int32, xmm1, edi, ecx, xmm2);
1671 if (op_ == Token::MOD) { 1671 if (op_ == Token::MOD) {
1672 if (has_fixed_right_arg_) { 1672 if (encoded_right_arg_.has_value) {
1673 __ cmp(edi, Immediate(fixed_right_arg_value())); 1673 __ cmp(edi, Immediate(fixed_right_arg_value()));
1674 __ j(not_equal, &right_arg_changed); 1674 __ j(not_equal, &right_arg_changed);
1675 } 1675 }
1676 GenerateRegisterArgsPush(masm); 1676 GenerateRegisterArgsPush(masm);
1677 __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION); 1677 __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION);
1678 } else { 1678 } else {
1679 switch (op_) { 1679 switch (op_) {
1680 case Token::ADD: __ addsd(xmm0, xmm1); break; 1680 case Token::ADD: __ addsd(xmm0, xmm1); break;
1681 case Token::SUB: __ subsd(xmm0, xmm1); break; 1681 case Token::SUB: __ subsd(xmm0, xmm1); break;
1682 case Token::MUL: __ mulsd(xmm0, xmm1); break; 1682 case Token::MUL: __ mulsd(xmm0, xmm1); break;
(...skipping 6411 matching lines...) Expand 10 before | Expand all | Expand 10 after
8094 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 8094 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
8095 } 8095 }
8096 } 8096 }
8097 8097
8098 8098
8099 #undef __ 8099 #undef __
8100 8100
8101 } } // namespace v8::internal 8101 } } // namespace v8::internal
8102 8102
8103 #endif // V8_TARGET_ARCH_IA32 8103 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698