OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/crankshaft/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { | 2401 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
2402 LOperand* char_code = UseRegister(instr->value()); | 2402 LOperand* char_code = UseRegister(instr->value()); |
2403 LOperand* context = UseAny(instr->context()); | 2403 LOperand* context = UseAny(instr->context()); |
2404 LStringCharFromCode* result = | 2404 LStringCharFromCode* result = |
2405 new(zone()) LStringCharFromCode(context, char_code); | 2405 new(zone()) LStringCharFromCode(context, char_code); |
2406 return AssignPointerMap(DefineAsRegister(result)); | 2406 return AssignPointerMap(DefineAsRegister(result)); |
2407 } | 2407 } |
2408 | 2408 |
2409 | 2409 |
2410 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 2410 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
2411 info()->MarkAsDeferredCalling(); | 2411 LOperand* size = instr->size()->IsConstant() ? UseConstant(instr->size()) |
2412 LOperand* context = UseAny(instr->context()); | 2412 : UseRegister(instr->size()); |
2413 LOperand* size = instr->size()->IsConstant() | 2413 if (instr->IsAllocationFolded()) { |
2414 ? UseConstant(instr->size()) | 2414 LOperand* temp = TempRegister(); |
2415 : UseTempRegister(instr->size()); | 2415 LFastAllocate* result = new (zone()) LFastAllocate(size, temp); |
2416 LOperand* temp = TempRegister(); | 2416 return DefineAsRegister(result); |
2417 LAllocate* result = new(zone()) LAllocate(context, size, temp); | 2417 } else { |
2418 return AssignPointerMap(DefineAsRegister(result)); | 2418 info()->MarkAsDeferredCalling(); |
| 2419 LOperand* context = UseAny(instr->context()); |
| 2420 LOperand* temp = TempRegister(); |
| 2421 LAllocate* result = new (zone()) LAllocate(context, size, temp); |
| 2422 return AssignPointerMap(DefineAsRegister(result)); |
| 2423 } |
2419 } | 2424 } |
2420 | 2425 |
2421 | 2426 |
2422 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { | 2427 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { |
2423 DCHECK(argument_count_ == 0); | 2428 DCHECK(argument_count_ == 0); |
2424 allocator_->MarkAsOsrEntry(); | 2429 allocator_->MarkAsOsrEntry(); |
2425 current_block_->last_environment()->set_ast_id(instr->ast_id()); | 2430 current_block_->last_environment()->set_ast_id(instr->ast_id()); |
2426 return AssignEnvironment(new(zone()) LOsrEntry); | 2431 return AssignEnvironment(new(zone()) LOsrEntry); |
2427 } | 2432 } |
2428 | 2433 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2592 LOperand* index = UseTempRegister(instr->index()); | 2597 LOperand* index = UseTempRegister(instr->index()); |
2593 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2598 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2594 LInstruction* result = DefineSameAsFirst(load); | 2599 LInstruction* result = DefineSameAsFirst(load); |
2595 return AssignPointerMap(result); | 2600 return AssignPointerMap(result); |
2596 } | 2601 } |
2597 | 2602 |
2598 } // namespace internal | 2603 } // namespace internal |
2599 } // namespace v8 | 2604 } // namespace v8 |
2600 | 2605 |
2601 #endif // V8_TARGET_ARCH_X64 | 2606 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |