| 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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 LOperand* context = UseFixed(instr->context(), rsi); | 1316 LOperand* context = UseFixed(instr->context(), rsi); |
| 1317 LOperand* constructor = UseFixed(instr->constructor(), rdi); | 1317 LOperand* constructor = UseFixed(instr->constructor(), rdi); |
| 1318 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); | 1318 LCallNewArray* result = new(zone()) LCallNewArray(context, constructor); |
| 1319 return MarkAsCall(DefineFixed(result, rax), instr); | 1319 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1320 } | 1320 } |
| 1321 | 1321 |
| 1322 | 1322 |
| 1323 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1323 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1324 LOperand* context = UseFixed(instr->context(), rsi); | 1324 LOperand* context = UseFixed(instr->context(), rsi); |
| 1325 LOperand* function = UseFixed(instr->function(), rdi); | 1325 LOperand* function = UseFixed(instr->function(), rdi); |
| 1326 LCallFunction* result = new(zone()) LCallFunction(context, function); | 1326 LCallFunction* call = new(zone()) LCallFunction(context, function); |
| 1327 return MarkAsCall(DefineFixed(result, rax), instr); | 1327 LInstruction* result = DefineFixed(call, rax); |
| 1328 if (instr->IsTailCall()) return result; |
| 1329 return MarkAsCall(result, instr); |
| 1328 } | 1330 } |
| 1329 | 1331 |
| 1330 | 1332 |
| 1331 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1333 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1332 LOperand* context = UseFixed(instr->context(), rsi); | 1334 LOperand* context = UseFixed(instr->context(), rsi); |
| 1333 LCallRuntime* result = new(zone()) LCallRuntime(context); | 1335 LCallRuntime* result = new(zone()) LCallRuntime(context); |
| 1334 return MarkAsCall(DefineFixed(result, rax), instr); | 1336 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1335 } | 1337 } |
| 1336 | 1338 |
| 1337 | 1339 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 } | 1667 } |
| 1666 | 1668 |
| 1667 | 1669 |
| 1668 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( | 1670 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( |
| 1669 HCompareHoleAndBranch* instr) { | 1671 HCompareHoleAndBranch* instr) { |
| 1670 LOperand* value = UseRegisterAtStart(instr->value()); | 1672 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1671 return new(zone()) LCmpHoleAndBranch(value); | 1673 return new(zone()) LCmpHoleAndBranch(value); |
| 1672 } | 1674 } |
| 1673 | 1675 |
| 1674 | 1676 |
| 1677 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( |
| 1678 HCompareMinusZeroAndBranch* instr) { |
| 1679 LInstruction* goto_instr = CheckElideControlInstruction(instr); |
| 1680 if (goto_instr != NULL) return goto_instr; |
| 1681 LOperand* value = UseRegister(instr->value()); |
| 1682 return new(zone()) LCompareMinusZeroAndBranch(value); |
| 1683 } |
| 1684 |
| 1685 |
| 1675 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { | 1686 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
| 1676 ASSERT(instr->value()->representation().IsTagged()); | 1687 ASSERT(instr->value()->representation().IsTagged()); |
| 1677 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); | 1688 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value())); |
| 1678 } | 1689 } |
| 1679 | 1690 |
| 1680 | 1691 |
| 1681 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { | 1692 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { |
| 1682 ASSERT(instr->value()->representation().IsTagged()); | 1693 ASSERT(instr->value()->representation().IsTagged()); |
| 1683 LOperand* value = UseRegisterAtStart(instr->value()); | 1694 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1684 LOperand* temp = TempRegister(); | 1695 LOperand* temp = TempRegister(); |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2406 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { | 2417 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { |
| 2407 LParameter* result = new(zone()) LParameter; | 2418 LParameter* result = new(zone()) LParameter; |
| 2408 if (instr->kind() == HParameter::STACK_PARAMETER) { | 2419 if (instr->kind() == HParameter::STACK_PARAMETER) { |
| 2409 int spill_index = chunk()->GetParameterStackSlot(instr->index()); | 2420 int spill_index = chunk()->GetParameterStackSlot(instr->index()); |
| 2410 return DefineAsSpilled(result, spill_index); | 2421 return DefineAsSpilled(result, spill_index); |
| 2411 } else { | 2422 } else { |
| 2412 ASSERT(info()->IsStub()); | 2423 ASSERT(info()->IsStub()); |
| 2413 CodeStubInterfaceDescriptor* descriptor = | 2424 CodeStubInterfaceDescriptor* descriptor = |
| 2414 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); | 2425 info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); |
| 2415 int index = static_cast<int>(instr->index()); | 2426 int index = static_cast<int>(instr->index()); |
| 2416 Register reg = DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index); | 2427 Register reg = descriptor->GetParameterRegister(index); |
| 2417 return DefineFixed(result, reg); | 2428 return DefineFixed(result, reg); |
| 2418 } | 2429 } |
| 2419 } | 2430 } |
| 2420 | 2431 |
| 2421 | 2432 |
| 2422 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2433 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2423 // Use an index that corresponds to the location in the unoptimized frame, | 2434 // Use an index that corresponds to the location in the unoptimized frame, |
| 2424 // which the optimized frame will subsume. | 2435 // which the optimized frame will subsume. |
| 2425 int env_index = instr->index(); | 2436 int env_index = instr->index(); |
| 2426 int spill_index = 0; | 2437 int spill_index = 0; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2602 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2613 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2603 LOperand* object = UseRegister(instr->object()); | 2614 LOperand* object = UseRegister(instr->object()); |
| 2604 LOperand* index = UseTempRegister(instr->index()); | 2615 LOperand* index = UseTempRegister(instr->index()); |
| 2605 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2616 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2606 } | 2617 } |
| 2607 | 2618 |
| 2608 | 2619 |
| 2609 } } // namespace v8::internal | 2620 } } // namespace v8::internal |
| 2610 | 2621 |
| 2611 #endif // V8_TARGET_ARCH_X64 | 2622 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |