| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3910 } | 3910 } |
| 3911 | 3911 |
| 3912 | 3912 |
| 3913 void LCodeGen::DoCallNew(LCallNew* instr) { | 3913 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 3914 ASSERT(ToRegister(instr->context()).is(cp)); | 3914 ASSERT(ToRegister(instr->context()).is(cp)); |
| 3915 ASSERT(ToRegister(instr->constructor()).is(a1)); | 3915 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 3916 ASSERT(ToRegister(instr->result()).is(v0)); | 3916 ASSERT(ToRegister(instr->result()).is(v0)); |
| 3917 | 3917 |
| 3918 __ li(a0, Operand(instr->arity())); | 3918 __ li(a0, Operand(instr->arity())); |
| 3919 // No cell in a2 for construct type feedback in optimized code | 3919 // No cell in a2 for construct type feedback in optimized code |
| 3920 Handle<Object> megamorphic_symbol = | 3920 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
| 3921 TypeFeedbackInfo::MegamorphicSentinel(isolate()); | |
| 3922 __ li(a2, Operand(megamorphic_symbol)); | |
| 3923 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 3921 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
| 3924 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3922 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3925 } | 3923 } |
| 3926 | 3924 |
| 3927 | 3925 |
| 3928 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3926 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3929 ASSERT(ToRegister(instr->context()).is(cp)); | 3927 ASSERT(ToRegister(instr->context()).is(cp)); |
| 3930 ASSERT(ToRegister(instr->constructor()).is(a1)); | 3928 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 3931 ASSERT(ToRegister(instr->result()).is(v0)); | 3929 ASSERT(ToRegister(instr->result()).is(v0)); |
| 3932 | 3930 |
| 3933 __ li(a0, Operand(instr->arity())); | 3931 __ li(a0, Operand(instr->arity())); |
| 3934 __ li(a2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate()))); | 3932 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
| 3935 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3933 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3936 AllocationSiteOverrideMode override_mode = | 3934 AllocationSiteOverrideMode override_mode = |
| 3937 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3935 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 3938 ? DISABLE_ALLOCATION_SITES | 3936 ? DISABLE_ALLOCATION_SITES |
| 3939 : DONT_OVERRIDE; | 3937 : DONT_OVERRIDE; |
| 3940 | 3938 |
| 3941 if (instr->arity() == 0) { | 3939 if (instr->arity() == 0) { |
| 3942 ArrayNoArgumentConstructorStub stub(kind, override_mode); | 3940 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
| 3943 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3941 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3944 } else if (instr->arity() == 1) { | 3942 } else if (instr->arity() == 1) { |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5793 __ Subu(scratch, result, scratch); | 5791 __ Subu(scratch, result, scratch); |
| 5794 __ lw(result, FieldMemOperand(scratch, | 5792 __ lw(result, FieldMemOperand(scratch, |
| 5795 FixedArray::kHeaderSize - kPointerSize)); | 5793 FixedArray::kHeaderSize - kPointerSize)); |
| 5796 __ bind(&done); | 5794 __ bind(&done); |
| 5797 } | 5795 } |
| 5798 | 5796 |
| 5799 | 5797 |
| 5800 #undef __ | 5798 #undef __ |
| 5801 | 5799 |
| 5802 } } // namespace v8::internal | 5800 } } // namespace v8::internal |
| OLD | NEW |