| 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 3863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3874 } | 3874 } |
| 3875 | 3875 |
| 3876 | 3876 |
| 3877 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3877 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3878 ASSERT(ToRegister(instr->constructor()).is(a1)); | 3878 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 3879 ASSERT(ToRegister(instr->result()).is(v0)); | 3879 ASSERT(ToRegister(instr->result()).is(v0)); |
| 3880 ASSERT(FLAG_optimize_constructed_arrays); | 3880 ASSERT(FLAG_optimize_constructed_arrays); |
| 3881 | 3881 |
| 3882 __ li(a0, Operand(instr->arity())); | 3882 __ li(a0, Operand(instr->arity())); |
| 3883 __ li(a2, Operand(instr->hydrogen()->property_cell())); | 3883 __ li(a2, Operand(instr->hydrogen()->property_cell())); |
| 3884 Object* cell_value = instr->hydrogen()->property_cell()->value(); | 3884 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3885 ElementsKind kind = static_cast<ElementsKind>(Smi::cast(cell_value)->value()); | |
| 3886 if (instr->arity() == 0) { | 3885 if (instr->arity() == 0) { |
| 3887 ArrayNoArgumentConstructorStub stub(kind); | 3886 ArrayNoArgumentConstructorStub stub(kind); |
| 3888 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3887 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3889 } else if (instr->arity() == 1) { | 3888 } else if (instr->arity() == 1) { |
| 3890 ArraySingleArgumentConstructorStub stub(kind); | 3889 ArraySingleArgumentConstructorStub stub(kind); |
| 3891 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3890 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3892 } else { | 3891 } else { |
| 3893 ArrayNArgumentsConstructorStub stub(kind); | 3892 ArrayNArgumentsConstructorStub stub(kind); |
| 3894 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3893 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3895 } | 3894 } |
| (...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5755 __ Subu(scratch, result, scratch); | 5754 __ Subu(scratch, result, scratch); |
| 5756 __ lw(result, FieldMemOperand(scratch, | 5755 __ lw(result, FieldMemOperand(scratch, |
| 5757 FixedArray::kHeaderSize - kPointerSize)); | 5756 FixedArray::kHeaderSize - kPointerSize)); |
| 5758 __ bind(&done); | 5757 __ bind(&done); |
| 5759 } | 5758 } |
| 5760 | 5759 |
| 5761 | 5760 |
| 5762 #undef __ | 5761 #undef __ |
| 5763 | 5762 |
| 5764 } } // namespace v8::internal | 5763 } } // namespace v8::internal |
| OLD | NEW |