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 4036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4047 ASSERT(ToRegister(instr->constructor()).is(r1)); | 4047 ASSERT(ToRegister(instr->constructor()).is(r1)); |
4048 ASSERT(ToRegister(instr->result()).is(r0)); | 4048 ASSERT(ToRegister(instr->result()).is(r0)); |
4049 | 4049 |
4050 __ mov(r0, Operand(instr->arity())); | 4050 __ mov(r0, Operand(instr->arity())); |
4051 __ mov(r2, Operand(instr->hydrogen()->property_cell())); | 4051 __ mov(r2, Operand(instr->hydrogen()->property_cell())); |
4052 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4052 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4053 AllocationSiteOverrideMode override_mode = | 4053 AllocationSiteOverrideMode override_mode = |
4054 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 4054 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
4055 ? DISABLE_ALLOCATION_SITES | 4055 ? DISABLE_ALLOCATION_SITES |
4056 : DONT_OVERRIDE; | 4056 : DONT_OVERRIDE; |
4057 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED; | |
4058 | 4057 |
4059 if (instr->arity() == 0) { | 4058 if (instr->arity() == 0) { |
4060 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode); | 4059 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
4061 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4060 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4062 } else if (instr->arity() == 1) { | 4061 } else if (instr->arity() == 1) { |
4063 Label done; | 4062 Label done; |
4064 if (IsFastPackedElementsKind(kind)) { | 4063 if (IsFastPackedElementsKind(kind)) { |
4065 Label packed_case; | 4064 Label packed_case; |
4066 // We might need a change here | 4065 // We might need a change here |
4067 // look at the first argument | 4066 // look at the first argument |
4068 __ ldr(r5, MemOperand(sp, 0)); | 4067 __ ldr(r5, MemOperand(sp, 0)); |
4069 __ cmp(r5, Operand::Zero()); | 4068 __ cmp(r5, Operand::Zero()); |
4070 __ b(eq, &packed_case); | 4069 __ b(eq, &packed_case); |
4071 | 4070 |
4072 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4071 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
4073 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode, | 4072 ArraySingleArgumentConstructorStub stub(holey_kind, override_mode); |
4074 override_mode); | |
4075 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4073 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4076 __ jmp(&done); | 4074 __ jmp(&done); |
4077 __ bind(&packed_case); | 4075 __ bind(&packed_case); |
4078 } | 4076 } |
4079 | 4077 |
4080 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode); | 4078 ArraySingleArgumentConstructorStub stub(kind, override_mode); |
4081 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4079 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4082 __ bind(&done); | 4080 __ bind(&done); |
4083 } else { | 4081 } else { |
4084 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); | 4082 ArrayNArgumentsConstructorStub stub(kind, override_mode); |
4085 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4083 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4086 } | 4084 } |
4087 } | 4085 } |
4088 | 4086 |
4089 | 4087 |
4090 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4088 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
4091 CallRuntime(instr->function(), instr->arity(), instr); | 4089 CallRuntime(instr->function(), instr->arity(), instr); |
4092 } | 4090 } |
4093 | 4091 |
4094 | 4092 |
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5812 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5810 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5813 __ ldr(result, FieldMemOperand(scratch, | 5811 __ ldr(result, FieldMemOperand(scratch, |
5814 FixedArray::kHeaderSize - kPointerSize)); | 5812 FixedArray::kHeaderSize - kPointerSize)); |
5815 __ bind(&done); | 5813 __ bind(&done); |
5816 } | 5814 } |
5817 | 5815 |
5818 | 5816 |
5819 #undef __ | 5817 #undef __ |
5820 | 5818 |
5821 } } // namespace v8::internal | 5819 } } // namespace v8::internal |
OLD | NEW |