| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 | 547 |
| 548 LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { | 548 LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { |
| 549 return value->IsConstant() | 549 return value->IsConstant() |
| 550 ? chunk_->DefineConstantOperand(HConstant::cast(value)) | 550 ? chunk_->DefineConstantOperand(HConstant::cast(value)) |
| 551 : UseRegisterAtStart(value); | 551 : UseRegisterAtStart(value); |
| 552 } | 552 } |
| 553 | 553 |
| 554 | 554 |
| 555 LOperand* LChunkBuilder::UseConstant(HValue* value) { |
| 556 return chunk_->DefineConstantOperand(HConstant::cast(value)); |
| 557 } |
| 558 |
| 559 |
| 555 LOperand* LChunkBuilder::UseAny(HValue* value) { | 560 LOperand* LChunkBuilder::UseAny(HValue* value) { |
| 556 return value->IsConstant() | 561 return value->IsConstant() |
| 557 ? chunk_->DefineConstantOperand(HConstant::cast(value)) | 562 ? chunk_->DefineConstantOperand(HConstant::cast(value)) |
| 558 : Use(value, new(zone()) LUnallocated(LUnallocated::ANY)); | 563 : Use(value, new(zone()) LUnallocated(LUnallocated::ANY)); |
| 559 } | 564 } |
| 560 | 565 |
| 561 | 566 |
| 562 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) { | 567 LOperand* LChunkBuilder::Use(HValue* value, LUnallocated* operand) { |
| 563 if (value->EmitAtUses()) { | 568 if (value->EmitAtUses()) { |
| 564 HInstruction* instr = HInstruction::cast(value); | 569 HInstruction* instr = HInstruction::cast(value); |
| (...skipping 1681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2246 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { | 2251 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { |
| 2247 info()->MarkAsDeferredCalling(); | 2252 info()->MarkAsDeferredCalling(); |
| 2248 LAllocateObject* result = | 2253 LAllocateObject* result = |
| 2249 new(zone()) LAllocateObject(TempRegister(), TempRegister()); | 2254 new(zone()) LAllocateObject(TempRegister(), TempRegister()); |
| 2250 return AssignPointerMap(DefineAsRegister(result)); | 2255 return AssignPointerMap(DefineAsRegister(result)); |
| 2251 } | 2256 } |
| 2252 | 2257 |
| 2253 | 2258 |
| 2254 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 2259 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
| 2255 info()->MarkAsDeferredCalling(); | 2260 info()->MarkAsDeferredCalling(); |
| 2256 LOperand* size = UseTempRegister(instr->size()); | 2261 LOperand* size = instr->size()->IsConstant() |
| 2262 ? UseConstant(instr->size()) |
| 2263 : UseTempRegister(instr->size()); |
| 2257 LOperand* temp1 = TempRegister(); | 2264 LOperand* temp1 = TempRegister(); |
| 2258 LOperand* temp2 = TempRegister(); | 2265 LOperand* temp2 = TempRegister(); |
| 2259 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); | 2266 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); |
| 2260 return AssignPointerMap(DefineAsRegister(result)); | 2267 return AssignPointerMap(DefineAsRegister(result)); |
| 2261 } | 2268 } |
| 2262 | 2269 |
| 2263 | 2270 |
| 2264 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 2271 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
| 2265 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, v0), instr); | 2272 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, v0), instr); |
| 2266 } | 2273 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 | 2496 |
| 2490 | 2497 |
| 2491 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2498 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2492 LOperand* object = UseRegister(instr->object()); | 2499 LOperand* object = UseRegister(instr->object()); |
| 2493 LOperand* index = UseRegister(instr->index()); | 2500 LOperand* index = UseRegister(instr->index()); |
| 2494 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2501 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2495 } | 2502 } |
| 2496 | 2503 |
| 2497 | 2504 |
| 2498 } } // namespace v8::internal | 2505 } } // namespace v8::internal |
| OLD | NEW |