OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 FPURegister src1, | 2097 FPURegister src1, |
2098 FPURegister src2) { | 2098 FPURegister src2) { |
2099 int right_block = instr->FalseDestination(chunk_); | 2099 int right_block = instr->FalseDestination(chunk_); |
2100 int left_block = instr->TrueDestination(chunk_); | 2100 int left_block = instr->TrueDestination(chunk_); |
2101 | 2101 |
2102 int next_block = GetNextEmittedBlock(); | 2102 int next_block = GetNextEmittedBlock(); |
2103 if (right_block == left_block) { | 2103 if (right_block == left_block) { |
2104 EmitGoto(left_block); | 2104 EmitGoto(left_block); |
2105 } else if (left_block == next_block) { | 2105 } else if (left_block == next_block) { |
2106 __ BranchF(chunk_->GetAssemblyLabel(right_block), NULL, | 2106 __ BranchF(chunk_->GetAssemblyLabel(right_block), NULL, |
2107 NegateCondition(condition), src1, src2); | 2107 NegateFpuCondition(condition), src1, src2); |
2108 } else if (right_block == next_block) { | 2108 } else if (right_block == next_block) { |
2109 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, | 2109 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, |
2110 condition, src1, src2); | 2110 condition, src1, src2); |
2111 } else { | 2111 } else { |
2112 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, | 2112 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, |
2113 condition, src1, src2); | 2113 condition, src1, src2); |
2114 __ Branch(chunk_->GetAssemblyLabel(right_block)); | 2114 __ Branch(chunk_->GetAssemblyLabel(right_block)); |
2115 } | 2115 } |
2116 } | 2116 } |
2117 | 2117 |
(...skipping 27 matching lines...) Expand all Loading... |
2145 void LCodeGen::DoBranch(LBranch* instr) { | 2145 void LCodeGen::DoBranch(LBranch* instr) { |
2146 Representation r = instr->hydrogen()->value()->representation(); | 2146 Representation r = instr->hydrogen()->value()->representation(); |
2147 if (r.IsInteger32() || r.IsSmi()) { | 2147 if (r.IsInteger32() || r.IsSmi()) { |
2148 DCHECK(!info()->IsStub()); | 2148 DCHECK(!info()->IsStub()); |
2149 Register reg = ToRegister(instr->value()); | 2149 Register reg = ToRegister(instr->value()); |
2150 EmitBranch(instr, ne, reg, Operand(zero_reg)); | 2150 EmitBranch(instr, ne, reg, Operand(zero_reg)); |
2151 } else if (r.IsDouble()) { | 2151 } else if (r.IsDouble()) { |
2152 DCHECK(!info()->IsStub()); | 2152 DCHECK(!info()->IsStub()); |
2153 DoubleRegister reg = ToDoubleRegister(instr->value()); | 2153 DoubleRegister reg = ToDoubleRegister(instr->value()); |
2154 // Test the double value. Zero and NaN are false. | 2154 // Test the double value. Zero and NaN are false. |
2155 EmitBranchF(instr, nue, reg, kDoubleRegZero); | 2155 EmitBranchF(instr, ogl, reg, kDoubleRegZero); |
2156 } else { | 2156 } else { |
2157 DCHECK(r.IsTagged()); | 2157 DCHECK(r.IsTagged()); |
2158 Register reg = ToRegister(instr->value()); | 2158 Register reg = ToRegister(instr->value()); |
2159 HType type = instr->hydrogen()->value()->type(); | 2159 HType type = instr->hydrogen()->value()->type(); |
2160 if (type.IsBoolean()) { | 2160 if (type.IsBoolean()) { |
2161 DCHECK(!info()->IsStub()); | 2161 DCHECK(!info()->IsStub()); |
2162 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 2162 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
2163 EmitBranch(instr, eq, reg, Operand(at)); | 2163 EmitBranch(instr, eq, reg, Operand(at)); |
2164 } else if (type.IsSmi()) { | 2164 } else if (type.IsSmi()) { |
2165 DCHECK(!info()->IsStub()); | 2165 DCHECK(!info()->IsStub()); |
2166 EmitBranch(instr, ne, reg, Operand(zero_reg)); | 2166 EmitBranch(instr, ne, reg, Operand(zero_reg)); |
2167 } else if (type.IsJSArray()) { | 2167 } else if (type.IsJSArray()) { |
2168 DCHECK(!info()->IsStub()); | 2168 DCHECK(!info()->IsStub()); |
2169 EmitBranch(instr, al, zero_reg, Operand(zero_reg)); | 2169 EmitBranch(instr, al, zero_reg, Operand(zero_reg)); |
2170 } else if (type.IsHeapNumber()) { | 2170 } else if (type.IsHeapNumber()) { |
2171 DCHECK(!info()->IsStub()); | 2171 DCHECK(!info()->IsStub()); |
2172 DoubleRegister dbl_scratch = double_scratch0(); | 2172 DoubleRegister dbl_scratch = double_scratch0(); |
2173 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2173 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2174 // Test the double value. Zero and NaN are false. | 2174 // Test the double value. Zero and NaN are false. |
2175 EmitBranchF(instr, nue, dbl_scratch, kDoubleRegZero); | 2175 EmitBranchF(instr, ogl, dbl_scratch, kDoubleRegZero); |
2176 } else if (type.IsString()) { | 2176 } else if (type.IsString()) { |
2177 DCHECK(!info()->IsStub()); | 2177 DCHECK(!info()->IsStub()); |
2178 __ lw(at, FieldMemOperand(reg, String::kLengthOffset)); | 2178 __ lw(at, FieldMemOperand(reg, String::kLengthOffset)); |
2179 EmitBranch(instr, ne, at, Operand(zero_reg)); | 2179 EmitBranch(instr, ne, at, Operand(zero_reg)); |
2180 } else { | 2180 } else { |
2181 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); | 2181 ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); |
2182 // Avoid deopts in the case where we've never executed this path before. | 2182 // Avoid deopts in the case where we've never executed this path before. |
2183 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); | 2183 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); |
2184 | 2184 |
2185 if (expected.Contains(ToBooleanStub::UNDEFINED)) { | 2185 if (expected.Contains(ToBooleanStub::UNDEFINED)) { |
(...skipping 3807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5993 __ li(at, scope_info); | 5993 __ li(at, scope_info); |
5994 __ Push(at, ToRegister(instr->function())); | 5994 __ Push(at, ToRegister(instr->function())); |
5995 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5995 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5996 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5996 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5997 } | 5997 } |
5998 | 5998 |
5999 | 5999 |
6000 #undef __ | 6000 #undef __ |
6001 | 6001 |
6002 } } // namespace v8::internal | 6002 } } // namespace v8::internal |
OLD | NEW |