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 4151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4162 CALL_AS_FUNCTION, | 4162 CALL_AS_FUNCTION, |
4163 EDI_UNINITIALIZED); | 4163 EDI_UNINITIALIZED); |
4164 } | 4164 } |
4165 | 4165 |
4166 | 4166 |
4167 void LCodeGen::DoCallNew(LCallNew* instr) { | 4167 void LCodeGen::DoCallNew(LCallNew* instr) { |
4168 ASSERT(ToRegister(instr->context()).is(esi)); | 4168 ASSERT(ToRegister(instr->context()).is(esi)); |
4169 ASSERT(ToRegister(instr->constructor()).is(edi)); | 4169 ASSERT(ToRegister(instr->constructor()).is(edi)); |
4170 ASSERT(ToRegister(instr->result()).is(eax)); | 4170 ASSERT(ToRegister(instr->result()).is(eax)); |
4171 | 4171 |
4172 if (FLAG_optimize_constructed_arrays) { | 4172 // No cell in ebx for construct type feedback in optimized code |
4173 // No cell in ebx for construct type feedback in optimized code | 4173 Handle<Object> undefined_value(isolate()->factory()->undefined_value()); |
4174 Handle<Object> undefined_value(isolate()->heap()->undefined_value(), | 4174 __ mov(ebx, Immediate(undefined_value)); |
4175 isolate()); | |
4176 __ mov(ebx, Immediate(undefined_value)); | |
4177 } | |
4178 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 4175 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
4179 __ Set(eax, Immediate(instr->arity())); | 4176 __ Set(eax, Immediate(instr->arity())); |
4180 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4177 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4181 } | 4178 } |
4182 | 4179 |
4183 | 4180 |
4184 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 4181 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
4185 ASSERT(ToRegister(instr->context()).is(esi)); | 4182 ASSERT(ToRegister(instr->context()).is(esi)); |
4186 ASSERT(ToRegister(instr->constructor()).is(edi)); | 4183 ASSERT(ToRegister(instr->constructor()).is(edi)); |
4187 ASSERT(ToRegister(instr->result()).is(eax)); | 4184 ASSERT(ToRegister(instr->result()).is(eax)); |
4188 ASSERT(FLAG_optimize_constructed_arrays); | |
4189 | 4185 |
4190 __ Set(eax, Immediate(instr->arity())); | 4186 __ Set(eax, Immediate(instr->arity())); |
4191 __ mov(ebx, instr->hydrogen()->property_cell()); | 4187 __ mov(ebx, instr->hydrogen()->property_cell()); |
4192 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4188 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4193 bool disable_allocation_sites = | 4189 bool disable_allocation_sites = |
4194 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4190 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
4195 | 4191 |
4196 if (instr->arity() == 0) { | 4192 if (instr->arity() == 0) { |
4197 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4193 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
4198 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4194 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6560 FixedArray::kHeaderSize - kPointerSize)); | 6556 FixedArray::kHeaderSize - kPointerSize)); |
6561 __ bind(&done); | 6557 __ bind(&done); |
6562 } | 6558 } |
6563 | 6559 |
6564 | 6560 |
6565 #undef __ | 6561 #undef __ |
6566 | 6562 |
6567 } } // namespace v8::internal | 6563 } } // namespace v8::internal |
6568 | 6564 |
6569 #endif // V8_TARGET_ARCH_IA32 | 6565 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |