| 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 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1860   __ stop("LDebugBreak"); |  1860   __ stop("LDebugBreak"); | 
|  1861 } |  1861 } | 
|  1862  |  1862  | 
|  1863  |  1863  | 
|  1864 void LCodeGen::DoBranch(LBranch* instr) { |  1864 void LCodeGen::DoBranch(LBranch* instr) { | 
|  1865   int true_block = chunk_->LookupDestination(instr->true_block_id()); |  1865   int true_block = chunk_->LookupDestination(instr->true_block_id()); | 
|  1866   int false_block = chunk_->LookupDestination(instr->false_block_id()); |  1866   int false_block = chunk_->LookupDestination(instr->false_block_id()); | 
|  1867  |  1867  | 
|  1868   Representation r = instr->hydrogen()->value()->representation(); |  1868   Representation r = instr->hydrogen()->value()->representation(); | 
|  1869   if (r.IsInteger32() || r.IsSmi()) { |  1869   if (r.IsInteger32() || r.IsSmi()) { | 
 |  1870     ASSERT(!info()->IsStub()); | 
|  1870     Register reg = ToRegister(instr->value()); |  1871     Register reg = ToRegister(instr->value()); | 
|  1871     EmitBranch(true_block, false_block, ne, reg, Operand(zero_reg)); |  1872     EmitBranch(true_block, false_block, ne, reg, Operand(zero_reg)); | 
|  1872   } else if (r.IsDouble()) { |  1873   } else if (r.IsDouble()) { | 
 |  1874     ASSERT(!info()->IsStub()); | 
|  1873     DoubleRegister reg = ToDoubleRegister(instr->value()); |  1875     DoubleRegister reg = ToDoubleRegister(instr->value()); | 
|  1874     // Test the double value. Zero and NaN are false. |  1876     // Test the double value. Zero and NaN are false. | 
|  1875     EmitBranchF(true_block, false_block, nue, reg, kDoubleRegZero); |  1877     EmitBranchF(true_block, false_block, nue, reg, kDoubleRegZero); | 
|  1876   } else { |  1878   } else { | 
|  1877     ASSERT(r.IsTagged()); |  1879     ASSERT(r.IsTagged()); | 
|  1878     Register reg = ToRegister(instr->value()); |  1880     Register reg = ToRegister(instr->value()); | 
|  1879     HType type = instr->hydrogen()->value()->type(); |  1881     HType type = instr->hydrogen()->value()->type(); | 
|  1880     if (type.IsBoolean()) { |  1882     if (type.IsBoolean()) { | 
 |  1883       ASSERT(!info()->IsStub()); | 
|  1881       __ LoadRoot(at, Heap::kTrueValueRootIndex); |  1884       __ LoadRoot(at, Heap::kTrueValueRootIndex); | 
|  1882       EmitBranch(true_block, false_block, eq, reg, Operand(at)); |  1885       EmitBranch(true_block, false_block, eq, reg, Operand(at)); | 
|  1883     } else if (type.IsSmi()) { |  1886     } else if (type.IsSmi()) { | 
 |  1887       ASSERT(!info()->IsStub()); | 
|  1884       EmitBranch(true_block, false_block, ne, reg, Operand(zero_reg)); |  1888       EmitBranch(true_block, false_block, ne, reg, Operand(zero_reg)); | 
|  1885     } else { |  1889     } else { | 
|  1886       Label* true_label = chunk_->GetAssemblyLabel(true_block); |  1890       Label* true_label = chunk_->GetAssemblyLabel(true_block); | 
|  1887       Label* false_label = chunk_->GetAssemblyLabel(false_block); |  1891       Label* false_label = chunk_->GetAssemblyLabel(false_block); | 
|  1888  |  1892  | 
|  1889       ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); |  1893       ToBooleanStub::Types expected = instr->hydrogen()->expected_input_types(); | 
|  1890       // Avoid deopts in the case where we've never executed this path before. |  1894       // Avoid deopts in the case where we've never executed this path before. | 
|  1891       if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); |  1895       if (expected.IsEmpty()) expected = ToBooleanStub::all_types(); | 
|  1892  |  1896  | 
|  1893       if (expected.Contains(ToBooleanStub::UNDEFINED)) { |  1897       if (expected.Contains(ToBooleanStub::UNDEFINED)) { | 
| (...skipping 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5738   __ Subu(scratch, result, scratch); |  5742   __ Subu(scratch, result, scratch); | 
|  5739   __ lw(result, FieldMemOperand(scratch, |  5743   __ lw(result, FieldMemOperand(scratch, | 
|  5740                                 FixedArray::kHeaderSize - kPointerSize)); |  5744                                 FixedArray::kHeaderSize - kPointerSize)); | 
|  5741   __ bind(&done); |  5745   __ bind(&done); | 
|  5742 } |  5746 } | 
|  5743  |  5747  | 
|  5744  |  5748  | 
|  5745 #undef __ |  5749 #undef __ | 
|  5746  |  5750  | 
|  5747 } }  // namespace v8::internal |  5751 } }  // namespace v8::internal | 
| OLD | NEW |