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 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { | 2376 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { |
2372 info()->MarkAsDeferredCalling(); | 2377 info()->MarkAsDeferredCalling(); |
2373 LAllocateObject* result = | 2378 LAllocateObject* result = |
2374 new(zone()) LAllocateObject(TempRegister(), TempRegister()); | 2379 new(zone()) LAllocateObject(TempRegister(), TempRegister()); |
2375 return AssignPointerMap(DefineAsRegister(result)); | 2380 return AssignPointerMap(DefineAsRegister(result)); |
2376 } | 2381 } |
2377 | 2382 |
2378 | 2383 |
2379 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { | 2384 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
2380 info()->MarkAsDeferredCalling(); | 2385 info()->MarkAsDeferredCalling(); |
2381 LOperand* size = UseTempRegister(instr->size()); | 2386 LOperand* size = instr->size()->IsConstant() |
| 2387 ? UseConstant(instr->size()) |
| 2388 : UseTempRegister(instr->size()); |
2382 LOperand* temp1 = TempRegister(); | 2389 LOperand* temp1 = TempRegister(); |
2383 LOperand* temp2 = TempRegister(); | 2390 LOperand* temp2 = TempRegister(); |
2384 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); | 2391 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); |
2385 return AssignPointerMap(DefineAsRegister(result)); | 2392 return AssignPointerMap(DefineAsRegister(result)); |
2386 } | 2393 } |
2387 | 2394 |
2388 | 2395 |
2389 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 2396 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
2390 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, r0), instr); | 2397 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, r0), instr); |
2391 } | 2398 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2614 | 2621 |
2615 | 2622 |
2616 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2623 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2617 LOperand* object = UseRegister(instr->object()); | 2624 LOperand* object = UseRegister(instr->object()); |
2618 LOperand* index = UseRegister(instr->index()); | 2625 LOperand* index = UseRegister(instr->index()); |
2619 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2626 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2620 } | 2627 } |
2621 | 2628 |
2622 | 2629 |
2623 } } // namespace v8::internal | 2630 } } // namespace v8::internal |
OLD | NEW |