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 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4276 CALL_AS_FUNCTION, | 4276 CALL_AS_FUNCTION, |
4277 R1_UNINITIALIZED); | 4277 R1_UNINITIALIZED); |
4278 } | 4278 } |
4279 | 4279 |
4280 | 4280 |
4281 void LCodeGen::DoCallNew(LCallNew* instr) { | 4281 void LCodeGen::DoCallNew(LCallNew* instr) { |
4282 ASSERT(ToRegister(instr->constructor()).is(r1)); | 4282 ASSERT(ToRegister(instr->constructor()).is(r1)); |
4283 ASSERT(ToRegister(instr->result()).is(r0)); | 4283 ASSERT(ToRegister(instr->result()).is(r0)); |
4284 | 4284 |
4285 __ mov(r0, Operand(instr->arity())); | 4285 __ mov(r0, Operand(instr->arity())); |
4286 // No cell in r2 for construct type feedback in optimized code | 4286 if (FLAG_optimize_constructed_arrays) { |
4287 Handle<Object> undefined_value(isolate()->heap()->undefined_value()); | 4287 // No cell in r2 for construct type feedback in optimized code |
4288 __ mov(r2, Operand(undefined_value)); | 4288 Handle<Object> undefined_value(isolate()->heap()->undefined_value(), |
| 4289 isolate()); |
| 4290 __ mov(r2, Operand(undefined_value)); |
| 4291 } |
4289 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 4292 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
4290 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4293 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4291 } | 4294 } |
4292 | 4295 |
4293 | 4296 |
4294 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 4297 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
4295 ASSERT(ToRegister(instr->constructor()).is(r1)); | 4298 ASSERT(ToRegister(instr->constructor()).is(r1)); |
4296 ASSERT(ToRegister(instr->result()).is(r0)); | 4299 ASSERT(ToRegister(instr->result()).is(r0)); |
| 4300 ASSERT(FLAG_optimize_constructed_arrays); |
4297 | 4301 |
4298 __ mov(r0, Operand(instr->arity())); | 4302 __ mov(r0, Operand(instr->arity())); |
4299 __ mov(r2, Operand(instr->hydrogen()->property_cell())); | 4303 __ mov(r2, Operand(instr->hydrogen()->property_cell())); |
4300 Handle<Code> array_construct_code = | 4304 Handle<Code> array_construct_code = |
4301 isolate()->builtins()->ArrayConstructCode(); | 4305 isolate()->builtins()->ArrayConstructCode(); |
4302 | 4306 |
4303 CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr); | 4307 CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr); |
4304 } | 4308 } |
4305 | 4309 |
4306 | 4310 |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6372 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6376 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6373 __ ldr(result, FieldMemOperand(scratch, | 6377 __ ldr(result, FieldMemOperand(scratch, |
6374 FixedArray::kHeaderSize - kPointerSize)); | 6378 FixedArray::kHeaderSize - kPointerSize)); |
6375 __ bind(&done); | 6379 __ bind(&done); |
6376 } | 6380 } |
6377 | 6381 |
6378 | 6382 |
6379 #undef __ | 6383 #undef __ |
6380 | 6384 |
6381 } } // namespace v8::internal | 6385 } } // namespace v8::internal |
OLD | NEW |