| 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 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4041 CALL_AS_FUNCTION, | 4041 CALL_AS_FUNCTION, |
| 4042 A1_UNINITIALIZED); | 4042 A1_UNINITIALIZED); |
| 4043 } | 4043 } |
| 4044 | 4044 |
| 4045 | 4045 |
| 4046 void LCodeGen::DoCallNew(LCallNew* instr) { | 4046 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 4047 ASSERT(ToRegister(instr->constructor()).is(a1)); | 4047 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 4048 ASSERT(ToRegister(instr->result()).is(v0)); | 4048 ASSERT(ToRegister(instr->result()).is(v0)); |
| 4049 | 4049 |
| 4050 __ li(a0, Operand(instr->arity())); | 4050 __ li(a0, Operand(instr->arity())); |
| 4051 if (FLAG_optimize_constructed_arrays) { | 4051 // No cell in a2 for construct type feedback in optimized code |
| 4052 // No cell in a2 for construct type feedback in optimized code | 4052 Handle<Object> undefined_value(isolate()->heap()->undefined_value(), |
| 4053 Handle<Object> undefined_value(isolate()->heap()->undefined_value(), | 4053 isolate()); |
| 4054 isolate()); | 4054 __ li(a2, Operand(undefined_value)); |
| 4055 __ li(a2, Operand(undefined_value)); | |
| 4056 } | |
| 4057 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 4055 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
| 4058 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4056 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4059 } | 4057 } |
| 4060 | 4058 |
| 4061 | 4059 |
| 4062 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 4060 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 4063 ASSERT(ToRegister(instr->constructor()).is(a1)); | 4061 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 4064 ASSERT(ToRegister(instr->result()).is(v0)); | 4062 ASSERT(ToRegister(instr->result()).is(v0)); |
| 4065 ASSERT(FLAG_optimize_constructed_arrays); | |
| 4066 | 4063 |
| 4067 __ li(a0, Operand(instr->arity())); | 4064 __ li(a0, Operand(instr->arity())); |
| 4068 __ li(a2, Operand(instr->hydrogen()->property_cell())); | 4065 __ li(a2, Operand(instr->hydrogen()->property_cell())); |
| 4069 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4066 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 4070 bool disable_allocation_sites = | 4067 bool disable_allocation_sites = |
| 4071 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4068 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
| 4072 | 4069 |
| 4073 if (instr->arity() == 0) { | 4070 if (instr->arity() == 0) { |
| 4074 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4071 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
| 4075 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4072 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| (...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5920 __ Subu(scratch, result, scratch); | 5917 __ Subu(scratch, result, scratch); |
| 5921 __ lw(result, FieldMemOperand(scratch, | 5918 __ lw(result, FieldMemOperand(scratch, |
| 5922 FixedArray::kHeaderSize - kPointerSize)); | 5919 FixedArray::kHeaderSize - kPointerSize)); |
| 5923 __ bind(&done); | 5920 __ bind(&done); |
| 5924 } | 5921 } |
| 5925 | 5922 |
| 5926 | 5923 |
| 5927 #undef __ | 5924 #undef __ |
| 5928 | 5925 |
| 5929 } } // namespace v8::internal | 5926 } } // namespace v8::internal |
| OLD | NEW |