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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 | 93 |
94 bool LInstruction::HasDoubleRegisterResult() { | 94 bool LInstruction::HasDoubleRegisterResult() { |
95 return HasResult() && result()->IsDoubleRegister(); | 95 return HasResult() && result()->IsDoubleRegister(); |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 bool LInstruction::HasDoubleRegisterInput() { | 99 bool LInstruction::HasDoubleRegisterInput() { |
100 for (int i = 0; i < InputCount(); i++) { | 100 for (int i = 0; i < InputCount(); i++) { |
101 LOperand* op = InputAt(i); | 101 LOperand* op = InputAt(i); |
102 if (op->IsDoubleRegister()) { | 102 if (op != NULL && op->IsDoubleRegister()) { |
103 return true; | 103 return true; |
104 } | 104 } |
105 } | 105 } |
106 return false; | 106 return false; |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 void LInstruction::PrintTo(StringStream* stream) { | 110 void LInstruction::PrintTo(StringStream* stream) { |
111 stream->Add("%s ", this->Mnemonic()); | 111 stream->Add("%s ", this->Mnemonic()); |
112 | 112 |
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 LOperand* context = UseAny(instr->context()); | 2509 LOperand* context = UseAny(instr->context()); |
2510 LOperand* temp = TempRegister(); | 2510 LOperand* temp = TempRegister(); |
2511 LAllocateObject* result = new(zone()) LAllocateObject(context, temp); | 2511 LAllocateObject* result = new(zone()) LAllocateObject(context, temp); |
2512 return AssignPointerMap(DefineAsRegister(result)); | 2512 return AssignPointerMap(DefineAsRegister(result)); |
2513 } | 2513 } |
2514 | 2514 |
2515 | 2515 |
2516 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 2516 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
2517 info()->MarkAsDeferredCalling(); | 2517 info()->MarkAsDeferredCalling(); |
2518 LOperand* context = UseAny(instr->context()); | 2518 LOperand* context = UseAny(instr->context()); |
| 2519 // TODO(mvstanton): why can't size be a constant if possible? |
2519 LOperand* size = UseTempRegister(instr->size()); | 2520 LOperand* size = UseTempRegister(instr->size()); |
2520 LOperand* temp = TempRegister(); | 2521 LOperand* temp = TempRegister(); |
2521 LAllocate* result = new(zone()) LAllocate(context, size, temp); | 2522 LAllocate* result = new(zone()) LAllocate(context, size, temp); |
2522 return AssignPointerMap(DefineAsRegister(result)); | 2523 return AssignPointerMap(DefineAsRegister(result)); |
2523 } | 2524 } |
2524 | 2525 |
2525 | 2526 |
2526 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 2527 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
2527 LOperand* context = UseFixed(instr->context(), esi); | 2528 LOperand* context = UseFixed(instr->context(), esi); |
2528 return MarkAsCall( | 2529 return MarkAsCall( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 | 2571 |
2571 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2572 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
2572 LParameter* result = new(zone()) LParameter; | 2573 LParameter* result = new(zone()) LParameter; |
2573 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2574 if (instr->kind() == HParameter::STACK_PARAMETER) { |
2574 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2575 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
2575 return DefineAsSpilled(result, spill_index); | 2576 return DefineAsSpilled(result, spill_index); |
2576 } else { | 2577 } else { |
2577 ASSERT(info()->IsStub()); | 2578 ASSERT(info()->IsStub()); |
2578 CodeStubInterfaceDescriptor* descriptor = | 2579 CodeStubInterfaceDescriptor* descriptor = |
2579 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); | 2580 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); |
2580 Register reg = descriptor->register_params_[instr->index()]; | 2581 int index = static_cast<int>(instr->index()); |
| 2582 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); |
2581 return DefineFixed(result, reg); | 2583 return DefineFixed(result, reg); |
2582 } | 2584 } |
2583 } | 2585 } |
2584 | 2586 |
2585 | 2587 |
2586 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2588 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
2587 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 2589 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
2588 if (spill_index > LUnallocated::kMaxFixedIndex) { | 2590 if (spill_index > LUnallocated::kMaxFixedIndex) { |
2589 Abort("Too many spill slots needed for OSR"); | 2591 Abort("Too many spill slots needed for OSR"); |
2590 spill_index = 0; | 2592 spill_index = 0; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2774 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2773 LOperand* object = UseRegister(instr->object()); | 2775 LOperand* object = UseRegister(instr->object()); |
2774 LOperand* index = UseTempRegister(instr->index()); | 2776 LOperand* index = UseTempRegister(instr->index()); |
2775 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2777 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2776 } | 2778 } |
2777 | 2779 |
2778 | 2780 |
2779 } } // namespace v8::internal | 2781 } } // namespace v8::internal |
2780 | 2782 |
2781 #endif // V8_TARGET_ARCH_IA32 | 2783 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |