| 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 LOperand* context = UseFixed(instr->context(), cp); | 1321 LOperand* context = UseFixed(instr->context(), cp); |
| 1322 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1322 LOperand* constructor = UseFixed(instr->constructor(), r1); |
| 1323 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); | 1323 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |
| 1324 return MarkAsCall(DefineFixed(result, r0), instr); | 1324 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 | 1327 |
| 1328 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1328 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1329 LOperand* context = UseFixed(instr->context(), cp); | 1329 LOperand* context = UseFixed(instr->context(), cp); |
| 1330 LOperand* function = UseFixed(instr->function(), r1); | 1330 LOperand* function = UseFixed(instr->function(), r1); |
| 1331 return MarkAsCall( | 1331 LCallFunction* call = new(zone()) LCallFunction(context, function); |
| 1332 DefineFixed(new(zone()) LCallFunction(context, function), r0), instr); | 1332 LInstruction* result = DefineFixed(call, r0); |
| 1333 if (instr->IsTailCall()) return result; |
| 1334 return MarkAsCall(result, instr); |
| 1333 } | 1335 } |
| 1334 | 1336 |
| 1335 | 1337 |
| 1336 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1338 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1337 LOperand* context = UseFixed(instr->context(), cp); | 1339 LOperand* context = UseFixed(instr->context(), cp); |
| 1338 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr); | 1340 return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr); |
| 1339 } | 1341 } |
| 1340 | 1342 |
| 1341 | 1343 |
| 1342 LInstruction* LChunkBuilder::DoRor(HRor* instr) { | 1344 LInstruction* LChunkBuilder::DoRor(HRor* instr) { |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 } | 1778 } |
| 1777 | 1779 |
| 1778 | 1780 |
| 1779 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( | 1781 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( |
| 1780 HCompareHoleAndBranch* instr) { | 1782 HCompareHoleAndBranch* instr) { |
| 1781 LOperand* value = UseRegisterAtStart(instr->value()); | 1783 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1782 return new(zone()) LCmpHoleAndBranch(value); | 1784 return new(zone()) LCmpHoleAndBranch(value); |
| 1783 } | 1785 } |
| 1784 | 1786 |
| 1785 | 1787 |
| 1788 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( |
| 1789 HCompareMinusZeroAndBranch* instr) { |
| 1790 LInstruction* goto_instr = CheckElideControlInstruction(instr); |
| 1791 if (goto_instr != NULL) return goto_instr; |
| 1792 LOperand* value = UseRegister(instr->value()); |
| 1793 LOperand* scratch = TempRegister(); |
| 1794 return new(zone()) LCompareMinusZeroAndBranch(value, scratch); |
| 1795 } |
| 1796 |
| 1797 |
| 1786 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1798 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
| 1787 ASSERT(instr->value()->representation().IsTagged()); | 1799 ASSERT(instr->value()->representation().IsTagged()); |
| 1788 LOperand* value = UseRegisterAtStart(instr->value()); | 1800 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1789 LOperand* temp = TempRegister(); | 1801 LOperand* temp = TempRegister(); |
| 1790 return new(zone()) LIsObjectAndBranch(value, temp); | 1802 return new(zone()) LIsObjectAndBranch(value, temp); |
| 1791 } | 1803 } |
| 1792 | 1804 |
| 1793 | 1805 |
| 1794 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | 1806 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { |
| 1795 ASSERT(instr->value()->representation().IsTagged()); | 1807 ASSERT(instr->value()->representation().IsTagged()); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2494 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
| 2483 LParameter* result = new(zone()) LParameter; | 2495 LParameter* result = new(zone()) LParameter; |
| 2484 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2496 if (instr->kind() == HParameter::STACK_PARAMETER) { |
| 2485 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2497 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
| 2486 return DefineAsSpilled(result, spill_index); | 2498 return DefineAsSpilled(result, spill_index); |
| 2487 } else { | 2499 } else { |
| 2488 ASSERT(info()->IsStub()); | 2500 ASSERT(info()->IsStub()); |
| 2489 CodeStubInterfaceDescriptor* descriptor = | 2501 CodeStubInterfaceDescriptor* descriptor = |
| 2490 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); | 2502 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); |
| 2491 int index = static_cast<int>(instr->index()); | 2503 int index = static_cast<int>(instr->index()); |
| 2492 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); | 2504 Register reg = descriptor->GetParameterRegister(index); |
| 2493 return DefineFixed(result, reg); | 2505 return DefineFixed(result, reg); |
| 2494 } | 2506 } |
| 2495 } | 2507 } |
| 2496 | 2508 |
| 2497 | 2509 |
| 2498 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2510 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2499 // Use an index that corresponds to the location in the unoptimized frame, | 2511 // Use an index that corresponds to the location in the unoptimized frame, |
| 2500 // which the optimized frame will subsume. | 2512 // which the optimized frame will subsume. |
| 2501 int env_index = instr->index(); | 2513 int env_index = instr->index(); |
| 2502 int spill_index = 0; | 2514 int spill_index = 0; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2672 | 2684 |
| 2673 | 2685 |
| 2674 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2686 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2675 LOperand* object = UseRegister(instr->object()); | 2687 LOperand* object = UseRegister(instr->object()); |
| 2676 LOperand* index = UseRegister(instr->index()); | 2688 LOperand* index = UseRegister(instr->index()); |
| 2677 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2689 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2678 } | 2690 } |
| 2679 | 2691 |
| 2680 | 2692 |
| 2681 } } // namespace v8::internal | 2693 } } // namespace v8::internal |
| OLD | NEW |