| 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 3902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3913 | 3913 |
| 3914 | 3914 |
| 3915 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3915 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3916 ASSERT(ToRegister(instr->constructor()).is(a1)); | 3916 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 3917 ASSERT(ToRegister(instr->result()).is(v0)); | 3917 ASSERT(ToRegister(instr->result()).is(v0)); |
| 3918 ASSERT(FLAG_optimize_constructed_arrays); | 3918 ASSERT(FLAG_optimize_constructed_arrays); |
| 3919 | 3919 |
| 3920 __ li(a0, Operand(instr->arity())); | 3920 __ li(a0, Operand(instr->arity())); |
| 3921 __ li(a2, Operand(instr->hydrogen()->property_cell())); | 3921 __ li(a2, Operand(instr->hydrogen()->property_cell())); |
| 3922 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3922 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3923 bool disable_allocation_sites = |
| 3924 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
| 3925 |
| 3923 if (instr->arity() == 0) { | 3926 if (instr->arity() == 0) { |
| 3924 ArrayNoArgumentConstructorStub stub(kind); | 3927 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
| 3925 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3928 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3926 } else if (instr->arity() == 1) { | 3929 } else if (instr->arity() == 1) { |
| 3927 ArraySingleArgumentConstructorStub stub(kind); | 3930 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); |
| 3928 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3931 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3929 } else { | 3932 } else { |
| 3930 ArrayNArgumentsConstructorStub stub(kind); | 3933 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); |
| 3931 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3934 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3932 } | 3935 } |
| 3933 } | 3936 } |
| 3934 | 3937 |
| 3935 | 3938 |
| 3936 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3939 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 3937 CallRuntime(instr->function(), instr->arity(), instr); | 3940 CallRuntime(instr->function(), instr->arity(), instr); |
| 3938 } | 3941 } |
| 3939 | 3942 |
| 3940 | 3943 |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5693 __ Subu(scratch, result, scratch); | 5696 __ Subu(scratch, result, scratch); |
| 5694 __ lw(result, FieldMemOperand(scratch, | 5697 __ lw(result, FieldMemOperand(scratch, |
| 5695 FixedArray::kHeaderSize - kPointerSize)); | 5698 FixedArray::kHeaderSize - kPointerSize)); |
| 5696 __ bind(&done); | 5699 __ bind(&done); |
| 5697 } | 5700 } |
| 5698 | 5701 |
| 5699 | 5702 |
| 5700 #undef __ | 5703 #undef __ |
| 5701 | 5704 |
| 5702 } } // namespace v8::internal | 5705 } } // namespace v8::internal |
| OLD | NEW |