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 4111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4122 } | 4122 } |
4123 | 4123 |
4124 | 4124 |
4125 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 4125 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
4126 ASSERT(ToRegister(instr->constructor()).is(r1)); | 4126 ASSERT(ToRegister(instr->constructor()).is(r1)); |
4127 ASSERT(ToRegister(instr->result()).is(r0)); | 4127 ASSERT(ToRegister(instr->result()).is(r0)); |
4128 | 4128 |
4129 __ mov(r0, Operand(instr->arity())); | 4129 __ mov(r0, Operand(instr->arity())); |
4130 __ mov(r2, Operand(instr->hydrogen()->property_cell())); | 4130 __ mov(r2, Operand(instr->hydrogen()->property_cell())); |
4131 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4131 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4132 bool disable_allocation_sites = | 4132 AllocationSiteOverrideMode override_mode = |
4133 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4133 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 4134 ? DISABLE_ALLOCATION_SITES |
| 4135 : DONT_OVERRIDE; |
| 4136 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED; |
4134 | 4137 |
4135 if (instr->arity() == 0) { | 4138 if (instr->arity() == 0) { |
4136 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4139 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode); |
4137 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4140 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4138 } else if (instr->arity() == 1) { | 4141 } else if (instr->arity() == 1) { |
4139 Label done; | 4142 Label done; |
4140 if (IsFastPackedElementsKind(kind)) { | 4143 if (IsFastPackedElementsKind(kind)) { |
4141 Label packed_case; | 4144 Label packed_case; |
4142 // We might need a change here | 4145 // We might need a change here |
4143 // look at the first argument | 4146 // look at the first argument |
4144 __ ldr(r5, MemOperand(sp, 0)); | 4147 __ ldr(r5, MemOperand(sp, 0)); |
4145 __ cmp(r5, Operand::Zero()); | 4148 __ cmp(r5, Operand::Zero()); |
4146 __ b(eq, &packed_case); | 4149 __ b(eq, &packed_case); |
4147 | 4150 |
4148 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4151 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
4149 ArraySingleArgumentConstructorStub stub(holey_kind, | 4152 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode, |
4150 disable_allocation_sites); | 4153 override_mode); |
4151 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4154 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4152 __ jmp(&done); | 4155 __ jmp(&done); |
4153 __ bind(&packed_case); | 4156 __ bind(&packed_case); |
4154 } | 4157 } |
4155 | 4158 |
4156 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 4159 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode); |
4157 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4160 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4158 __ bind(&done); | 4161 __ bind(&done); |
4159 } else { | 4162 } else { |
4160 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 4163 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); |
4161 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4164 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4162 } | 4165 } |
4163 } | 4166 } |
4164 | 4167 |
4165 | 4168 |
4166 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4169 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
4167 CallRuntime(instr->function(), instr->arity(), instr); | 4170 CallRuntime(instr->function(), instr->arity(), instr); |
4168 } | 4171 } |
4169 | 4172 |
4170 | 4173 |
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5908 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5911 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5909 __ ldr(result, FieldMemOperand(scratch, | 5912 __ ldr(result, FieldMemOperand(scratch, |
5910 FixedArray::kHeaderSize - kPointerSize)); | 5913 FixedArray::kHeaderSize - kPointerSize)); |
5911 __ bind(&done); | 5914 __ bind(&done); |
5912 } | 5915 } |
5913 | 5916 |
5914 | 5917 |
5915 #undef __ | 5918 #undef __ |
5916 | 5919 |
5917 } } // namespace v8::internal | 5920 } } // namespace v8::internal |
OLD | NEW |