| OLD | NEW |
| 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 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 condition, src1, src2); | 2032 condition, src1, src2); |
| 2033 } else { | 2033 } else { |
| 2034 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, | 2034 __ BranchF(chunk_->GetAssemblyLabel(left_block), NULL, |
| 2035 condition, src1, src2); | 2035 condition, src1, src2); |
| 2036 __ Branch(chunk_->GetAssemblyLabel(right_block)); | 2036 __ Branch(chunk_->GetAssemblyLabel(right_block)); |
| 2037 } | 2037 } |
| 2038 } | 2038 } |
| 2039 | 2039 |
| 2040 | 2040 |
| 2041 template<class InstrType> | 2041 template<class InstrType> |
| 2042 void LCodeGen::EmitFalseBranch(InstrType instr, |
| 2043 Condition condition, |
| 2044 Register src1, |
| 2045 const Operand& src2) { |
| 2046 int false_block = instr->FalseDestination(chunk_); |
| 2047 __ Branch(chunk_->GetAssemblyLabel(false_block), condition, src1, src2); |
| 2048 } |
| 2049 |
| 2050 |
| 2051 template<class InstrType> |
| 2042 void LCodeGen::EmitFalseBranchF(InstrType instr, | 2052 void LCodeGen::EmitFalseBranchF(InstrType instr, |
| 2043 Condition condition, | 2053 Condition condition, |
| 2044 FPURegister src1, | 2054 FPURegister src1, |
| 2045 FPURegister src2) { | 2055 FPURegister src2) { |
| 2046 int false_block = instr->FalseDestination(chunk_); | 2056 int false_block = instr->FalseDestination(chunk_); |
| 2047 __ BranchF(chunk_->GetAssemblyLabel(false_block), NULL, | 2057 __ BranchF(chunk_->GetAssemblyLabel(false_block), NULL, |
| 2048 condition, src1, src2); | 2058 condition, src1, src2); |
| 2049 } | 2059 } |
| 2050 | 2060 |
| 2051 | 2061 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 | 2317 |
| 2308 Register scratch = scratch0(); | 2318 Register scratch = scratch0(); |
| 2309 __ FmoveHigh(scratch, input_reg); | 2319 __ FmoveHigh(scratch, input_reg); |
| 2310 EmitBranch(instr, eq, scratch, Operand(kHoleNanUpper32)); | 2320 EmitBranch(instr, eq, scratch, Operand(kHoleNanUpper32)); |
| 2311 } | 2321 } |
| 2312 | 2322 |
| 2313 | 2323 |
| 2314 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { | 2324 void LCodeGen::DoCompareMinusZeroAndBranch(LCompareMinusZeroAndBranch* instr) { |
| 2315 Representation rep = instr->hydrogen()->value()->representation(); | 2325 Representation rep = instr->hydrogen()->value()->representation(); |
| 2316 ASSERT(!rep.IsInteger32()); | 2326 ASSERT(!rep.IsInteger32()); |
| 2317 Label if_false; | |
| 2318 Register scratch = ToRegister(instr->temp()); | 2327 Register scratch = ToRegister(instr->temp()); |
| 2319 | 2328 |
| 2320 if (rep.IsDouble()) { | 2329 if (rep.IsDouble()) { |
| 2321 DoubleRegister value = ToDoubleRegister(instr->value()); | 2330 DoubleRegister value = ToDoubleRegister(instr->value()); |
| 2322 __ BranchF(&if_false, NULL, ne, value, kDoubleRegZero); | 2331 EmitFalseBranchF(instr, ne, value, kDoubleRegZero); |
| 2323 __ FmoveHigh(scratch, value); | 2332 __ FmoveHigh(scratch, value); |
| 2324 __ li(at, 0x80000000); | 2333 __ li(at, 0x80000000); |
| 2325 } else { | 2334 } else { |
| 2326 Register value = ToRegister(instr->value()); | 2335 Register value = ToRegister(instr->value()); |
| 2327 __ CheckMap( | 2336 __ CheckMap(value, |
| 2328 value, scratch, Heap::kHeapNumberMapRootIndex, &if_false, DO_SMI_CHECK); | 2337 scratch, |
| 2338 Heap::kHeapNumberMapRootIndex, |
| 2339 instr->FalseLabel(chunk()), |
| 2340 DO_SMI_CHECK); |
| 2329 __ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); | 2341 __ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); |
| 2330 __ Branch(&if_false, ne, scratch, Operand(0x80000000)); | 2342 EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); |
| 2331 __ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); | 2343 __ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); |
| 2332 __ mov(at, zero_reg); | 2344 __ mov(at, zero_reg); |
| 2333 } | 2345 } |
| 2334 EmitBranch(instr, eq, scratch, Operand(at)); | 2346 EmitBranch(instr, eq, scratch, Operand(at)); |
| 2335 | |
| 2336 __ bind(&if_false); | |
| 2337 EmitFalseBranchF(instr, al, kDoubleRegZero, kDoubleRegZero); | |
| 2338 } | 2347 } |
| 2339 | 2348 |
| 2340 | 2349 |
| 2341 Condition LCodeGen::EmitIsObject(Register input, | 2350 Condition LCodeGen::EmitIsObject(Register input, |
| 2342 Register temp1, | 2351 Register temp1, |
| 2343 Register temp2, | 2352 Register temp2, |
| 2344 Label* is_not_object, | 2353 Label* is_not_object, |
| 2345 Label* is_object) { | 2354 Label* is_object) { |
| 2346 __ JumpIfSmi(input, is_not_object); | 2355 __ JumpIfSmi(input, is_not_object); |
| 2347 | 2356 |
| (...skipping 3533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5881 __ Subu(scratch, result, scratch); | 5890 __ Subu(scratch, result, scratch); |
| 5882 __ lw(result, FieldMemOperand(scratch, | 5891 __ lw(result, FieldMemOperand(scratch, |
| 5883 FixedArray::kHeaderSize - kPointerSize)); | 5892 FixedArray::kHeaderSize - kPointerSize)); |
| 5884 __ bind(&done); | 5893 __ bind(&done); |
| 5885 } | 5894 } |
| 5886 | 5895 |
| 5887 | 5896 |
| 5888 #undef __ | 5897 #undef __ |
| 5889 | 5898 |
| 5890 } } // namespace v8::internal | 5899 } } // namespace v8::internal |
| OLD | NEW |