OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5097 Register result = ToRegister(instr->result()); | 5097 Register result = ToRegister(instr->result()); |
5098 | 5098 |
5099 // TODO(3095996): Get rid of this. For now, we need to make the | 5099 // TODO(3095996): Get rid of this. For now, we need to make the |
5100 // result register contain a valid pointer because it is already | 5100 // result register contain a valid pointer because it is already |
5101 // contained in the register pointer map. | 5101 // contained in the register pointer map. |
5102 __ Set(result, 0); | 5102 __ Set(result, 0); |
5103 | 5103 |
5104 PushSafepointRegistersScope scope(this); | 5104 PushSafepointRegistersScope scope(this); |
5105 __ Integer32ToSmi(size, size); | 5105 __ Integer32ToSmi(size, size); |
5106 __ push(size); | 5106 __ push(size); |
5107 CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); | 5107 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { |
| 5108 CallRuntimeFromDeferred( |
| 5109 Runtime::kAllocateInOldPointerSpace, 1, instr); |
| 5110 } else { |
| 5111 CallRuntimeFromDeferred( |
| 5112 Runtime::kAllocateInNewSpace, 1, instr); |
| 5113 } |
5108 __ StoreToSafepointRegisterSlot(result, rax); | 5114 __ StoreToSafepointRegisterSlot(result, rax); |
5109 } | 5115 } |
5110 | 5116 |
5111 | 5117 |
5112 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 5118 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
5113 Handle<FixedArray> literals(instr->environment()->closure()->literals()); | 5119 Handle<FixedArray> literals(instr->environment()->closure()->literals()); |
5114 ElementsKind boilerplate_elements_kind = | 5120 ElementsKind boilerplate_elements_kind = |
5115 instr->hydrogen()->boilerplate_elements_kind(); | 5121 instr->hydrogen()->boilerplate_elements_kind(); |
5116 AllocationSiteMode allocation_site_mode = | 5122 AllocationSiteMode allocation_site_mode = |
5117 instr->hydrogen()->allocation_site_mode(); | 5123 instr->hydrogen()->allocation_site_mode(); |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5654 FixedArray::kHeaderSize - kPointerSize)); | 5660 FixedArray::kHeaderSize - kPointerSize)); |
5655 __ bind(&done); | 5661 __ bind(&done); |
5656 } | 5662 } |
5657 | 5663 |
5658 | 5664 |
5659 #undef __ | 5665 #undef __ |
5660 | 5666 |
5661 } } // namespace v8::internal | 5667 } } // namespace v8::internal |
5662 | 5668 |
5663 #endif // V8_TARGET_ARCH_X64 | 5669 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |