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 5454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5465 Register result = ToRegister(instr->result()); | 5465 Register result = ToRegister(instr->result()); |
5466 | 5466 |
5467 // TODO(3095996): Get rid of this. For now, we need to make the | 5467 // TODO(3095996): Get rid of this. For now, we need to make the |
5468 // result register contain a valid pointer because it is already | 5468 // result register contain a valid pointer because it is already |
5469 // contained in the register pointer map. | 5469 // contained in the register pointer map. |
5470 __ mov(result, Operand(Smi::FromInt(0))); | 5470 __ mov(result, Operand(Smi::FromInt(0))); |
5471 | 5471 |
5472 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5472 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
5473 __ SmiTag(size, size); | 5473 __ SmiTag(size, size); |
5474 __ push(size); | 5474 __ push(size); |
5475 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); | 5475 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
| 5476 CallRuntimeFromDeferred( |
| 5477 Runtime::kAllocateInOldPointerSpace, 1, instr); |
| 5478 } else { |
| 5479 CallRuntimeFromDeferred( |
| 5480 Runtime::kAllocateInNewSpace, 1, instr); |
| 5481 } |
5476 __ StoreToSafepointRegisterSlot(r0, result); | 5482 __ StoreToSafepointRegisterSlot(r0, result); |
5477 } | 5483 } |
5478 | 5484 |
5479 | 5485 |
5480 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 5486 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
5481 Handle<FixedArray> literals(instr->environment()->closure()->literals()); | 5487 Handle<FixedArray> literals(instr->environment()->closure()->literals()); |
5482 ElementsKind boilerplate_elements_kind = | 5488 ElementsKind boilerplate_elements_kind = |
5483 instr->hydrogen()->boilerplate_elements_kind(); | 5489 instr->hydrogen()->boilerplate_elements_kind(); |
5484 AllocationSiteMode allocation_site_mode = | 5490 AllocationSiteMode allocation_site_mode = |
5485 instr->hydrogen()->allocation_site_mode(); | 5491 instr->hydrogen()->allocation_site_mode(); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6006 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6012 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
6007 __ ldr(result, FieldMemOperand(scratch, | 6013 __ ldr(result, FieldMemOperand(scratch, |
6008 FixedArray::kHeaderSize - kPointerSize)); | 6014 FixedArray::kHeaderSize - kPointerSize)); |
6009 __ bind(&done); | 6015 __ bind(&done); |
6010 } | 6016 } |
6011 | 6017 |
6012 | 6018 |
6013 #undef __ | 6019 #undef __ |
6014 | 6020 |
6015 } } // namespace v8::internal | 6021 } } // namespace v8::internal |
OLD | NEW |