OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1083 } | 1083 } |
1084 | 1084 |
1085 | 1085 |
1086 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 1086 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
1087 ASSERT(ToRegister(instr->left()).is(edx)); | 1087 ASSERT(ToRegister(instr->left()).is(edx)); |
1088 ASSERT(ToRegister(instr->right()).is(eax)); | 1088 ASSERT(ToRegister(instr->right()).is(eax)); |
1089 ASSERT(ToRegister(instr->result()).is(eax)); | 1089 ASSERT(ToRegister(instr->result()).is(eax)); |
1090 | 1090 |
1091 TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE); | 1091 TypeRecordingBinaryOpStub stub(instr->op(), NO_OVERWRITE); |
1092 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 1092 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
1093 __ nop(); // Signals no inlined smi code. | |
Vitaly Repeshko
2010/12/10 13:38:56
You can make CallCode emit the nop, if the code is
fschneider
2010/12/10 14:32:17
Done. (also for the CompareIC)
| |
1093 } | 1094 } |
1094 | 1095 |
1095 | 1096 |
1096 int LCodeGen::GetNextEmittedBlock(int block) { | 1097 int LCodeGen::GetNextEmittedBlock(int block) { |
1097 for (int i = block + 1; i < graph()->blocks()->length(); ++i) { | 1098 for (int i = block + 1; i < graph()->blocks()->length(); ++i) { |
1098 LLabel* label = chunk_->GetLabel(i); | 1099 LLabel* label = chunk_->GetLabel(i); |
1099 if (!label->HasReplacement()) return i; | 1100 if (!label->HasReplacement()) return i; |
1100 } | 1101 } |
1101 return -1; | 1102 return -1; |
1102 } | 1103 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1674 return no_condition; | 1675 return no_condition; |
1675 } | 1676 } |
1676 } | 1677 } |
1677 | 1678 |
1678 | 1679 |
1679 void LCodeGen::DoCmpT(LCmpT* instr) { | 1680 void LCodeGen::DoCmpT(LCmpT* instr) { |
1680 Token::Value op = instr->op(); | 1681 Token::Value op = instr->op(); |
1681 | 1682 |
1682 Handle<Code> ic = CompareIC::GetUninitialized(op); | 1683 Handle<Code> ic = CompareIC::GetUninitialized(op); |
1683 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1684 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
1685 __ nop(); // Signals no inlined smi code. | |
1684 | 1686 |
1685 Condition condition = ComputeCompareCondition(op); | 1687 Condition condition = ComputeCompareCondition(op); |
1686 if (op == Token::GT || op == Token::LTE) { | 1688 if (op == Token::GT || op == Token::LTE) { |
1687 condition = ReverseCondition(condition); | 1689 condition = ReverseCondition(condition); |
1688 } | 1690 } |
1689 NearLabel true_value, done; | 1691 NearLabel true_value, done; |
1690 __ test(eax, Operand(eax)); | 1692 __ test(eax, Operand(eax)); |
1691 __ j(condition, &true_value); | 1693 __ j(condition, &true_value); |
1692 __ mov(ToRegister(instr->result()), Factory::false_value()); | 1694 __ mov(ToRegister(instr->result()), Factory::false_value()); |
1693 __ jmp(&done); | 1695 __ jmp(&done); |
1694 __ bind(&true_value); | 1696 __ bind(&true_value); |
1695 __ mov(ToRegister(instr->result()), Factory::true_value()); | 1697 __ mov(ToRegister(instr->result()), Factory::true_value()); |
1696 __ bind(&done); | 1698 __ bind(&done); |
1697 } | 1699 } |
1698 | 1700 |
1699 | 1701 |
1700 void LCodeGen::DoCmpTAndBranch(LCmpTAndBranch* instr) { | 1702 void LCodeGen::DoCmpTAndBranch(LCmpTAndBranch* instr) { |
1701 Token::Value op = instr->op(); | 1703 Token::Value op = instr->op(); |
1702 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1704 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
1703 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1705 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
1704 | 1706 |
1705 Handle<Code> ic = CompareIC::GetUninitialized(op); | 1707 Handle<Code> ic = CompareIC::GetUninitialized(op); |
1706 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 1708 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
1709 __ nop(); // Signals no inlined smi code. | |
1707 | 1710 |
1708 // The compare stub expects compare condition and the input operands | 1711 // The compare stub expects compare condition and the input operands |
1709 // reversed for GT and LTE. | 1712 // reversed for GT and LTE. |
1710 Condition condition = ComputeCompareCondition(op); | 1713 Condition condition = ComputeCompareCondition(op); |
1711 if (op == Token::GT || op == Token::LTE) { | 1714 if (op == Token::GT || op == Token::LTE) { |
1712 condition = ReverseCondition(condition); | 1715 condition = ReverseCondition(condition); |
1713 } | 1716 } |
1714 __ test(eax, Operand(eax)); | 1717 __ test(eax, Operand(eax)); |
1715 EmitBranch(true_block, false_block, condition); | 1718 EmitBranch(true_block, false_block, condition); |
1716 } | 1719 } |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3155 ASSERT(!environment->HasBeenRegistered()); | 3158 ASSERT(!environment->HasBeenRegistered()); |
3156 RegisterEnvironmentForDeoptimization(environment); | 3159 RegisterEnvironmentForDeoptimization(environment); |
3157 ASSERT(osr_pc_offset_ == -1); | 3160 ASSERT(osr_pc_offset_ == -1); |
3158 osr_pc_offset_ = masm()->pc_offset(); | 3161 osr_pc_offset_ = masm()->pc_offset(); |
3159 } | 3162 } |
3160 | 3163 |
3161 | 3164 |
3162 #undef __ | 3165 #undef __ |
3163 | 3166 |
3164 } } // namespace v8::internal | 3167 } } // namespace v8::internal |
OLD | NEW |