| 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 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 LOperand* context = UseFixed(instr->context(), esi); | 1403 LOperand* context = UseFixed(instr->context(), esi); |
| 1404 LOperand* constructor = UseFixed(instr->constructor(), edi); | 1404 LOperand* constructor = UseFixed(instr->constructor(), edi); |
| 1405 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); | 1405 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |
| 1406 return MarkAsCall(DefineFixed(result, eax), instr); | 1406 return MarkAsCall(DefineFixed(result, eax), instr); |
| 1407 } | 1407 } |
| 1408 | 1408 |
| 1409 | 1409 |
| 1410 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1410 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1411 LOperand* context = UseFixed(instr->context(), esi); | 1411 LOperand* context = UseFixed(instr->context(), esi); |
| 1412 LOperand* function = UseFixed(instr->function(), edi); | 1412 LOperand* function = UseFixed(instr->function(), edi); |
| 1413 LCallFunction* result = new(zone()) LCallFunction(context, function); | 1413 LCallFunction* call = new(zone()) LCallFunction(context, function); |
| 1414 return MarkAsCall(DefineFixed(result, eax), instr); | 1414 LInstruction* result = DefineFixed(call, eax); |
| 1415 if (instr->IsTailCall()) return result; |
| 1416 return MarkAsCall(result, instr); |
| 1415 } | 1417 } |
| 1416 | 1418 |
| 1417 | 1419 |
| 1418 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1420 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1419 LOperand* context = UseFixed(instr->context(), esi); | 1421 LOperand* context = UseFixed(instr->context(), esi); |
| 1420 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), eax), instr); | 1422 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), eax), instr); |
| 1421 } | 1423 } |
| 1422 | 1424 |
| 1423 | 1425 |
| 1424 LInstruction* LChunkBuilder::DoRor(HRor* instr) { | 1426 LInstruction* LChunkBuilder::DoRor(HRor* instr) { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 } | 1763 } |
| 1762 | 1764 |
| 1763 | 1765 |
| 1764 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( | 1766 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( |
| 1765 HCompareHoleAndBranch* instr) { | 1767 HCompareHoleAndBranch* instr) { |
| 1766 LOperand* value = UseRegisterAtStart(instr->value()); | 1768 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1767 return new(zone()) LCmpHoleAndBranch(value); | 1769 return new(zone()) LCmpHoleAndBranch(value); |
| 1768 } | 1770 } |
| 1769 | 1771 |
| 1770 | 1772 |
| 1773 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( |
| 1774 HCompareMinusZeroAndBranch* instr) { |
| 1775 LInstruction* goto_instr = CheckElideControlInstruction(instr); |
| 1776 if (goto_instr != NULL) return goto_instr; |
| 1777 LOperand* value = UseRegister(instr->value()); |
| 1778 LOperand* scratch = TempRegister(); |
| 1779 return new(zone()) LCompareMinusZeroAndBranch(value, scratch); |
| 1780 } |
| 1781 |
| 1782 |
| 1771 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1783 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
| 1772 ASSERT(instr->value()->representation().IsSmiOrTagged()); | 1784 ASSERT(instr->value()->representation().IsSmiOrTagged()); |
| 1773 LOperand* temp = TempRegister(); | 1785 LOperand* temp = TempRegister(); |
| 1774 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp); | 1786 return new(zone()) LIsObjectAndBranch(UseRegister(instr->value()), temp); |
| 1775 } | 1787 } |
| 1776 | 1788 |
| 1777 | 1789 |
| 1778 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | 1790 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { |
| 1779 ASSERT(instr->value()->representation().IsTagged()); | 1791 ASSERT(instr->value()->representation().IsTagged()); |
| 1780 LOperand* temp = TempRegister(); | 1792 LOperand* temp = TempRegister(); |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2564 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
| 2553 LParameter* result = new(zone()) LParameter; | 2565 LParameter* result = new(zone()) LParameter; |
| 2554 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2566 if (instr->kind() == HParameter::STACK_PARAMETER) { |
| 2555 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2567 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
| 2556 return DefineAsSpilled(result, spill_index); | 2568 return DefineAsSpilled(result, spill_index); |
| 2557 } else { | 2569 } else { |
| 2558 ASSERT(info()->IsStub()); | 2570 ASSERT(info()->IsStub()); |
| 2559 CodeStubInterfaceDescriptor* descriptor = | 2571 CodeStubInterfaceDescriptor* descriptor = |
| 2560 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); | 2572 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); |
| 2561 int index = static_cast<int>(instr->index()); | 2573 int index = static_cast<int>(instr->index()); |
| 2562 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); | 2574 Register reg = descriptor->GetParameterRegister(index); |
| 2563 return DefineFixed(result, reg); | 2575 return DefineFixed(result, reg); |
| 2564 } | 2576 } |
| 2565 } | 2577 } |
| 2566 | 2578 |
| 2567 | 2579 |
| 2568 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2580 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2569 // Use an index that corresponds to the location in the unoptimized frame, | 2581 // Use an index that corresponds to the location in the unoptimized frame, |
| 2570 // which the optimized frame will subsume. | 2582 // which the optimized frame will subsume. |
| 2571 int env_index = instr->index(); | 2583 int env_index = instr->index(); |
| 2572 int spill_index = 0; | 2584 int spill_index = 0; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2753 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2765 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2754 LOperand* object = UseRegister(instr->object()); | 2766 LOperand* object = UseRegister(instr->object()); |
| 2755 LOperand* index = UseTempRegister(instr->index()); | 2767 LOperand* index = UseTempRegister(instr->index()); |
| 2756 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2757 } | 2769 } |
| 2758 | 2770 |
| 2759 | 2771 |
| 2760 } } // namespace v8::internal | 2772 } } // namespace v8::internal |
| 2761 | 2773 |
| 2762 #endif // V8_TARGET_ARCH_IA32 | 2774 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |