Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 23710070: Allow control intructions to have side effects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/hydrogen-instructions.cc ('K') | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 HInstruction* hinstr, 674 HInstruction* hinstr,
675 CanDeoptimize can_deoptimize) { 675 CanDeoptimize can_deoptimize) {
676 info()->MarkAsNonDeferredCalling(); 676 info()->MarkAsNonDeferredCalling();
677 677
678 #ifdef DEBUG 678 #ifdef DEBUG
679 instr->VerifyCall(); 679 instr->VerifyCall();
680 #endif 680 #endif
681 instr->MarkAsCall(); 681 instr->MarkAsCall();
682 instr = AssignPointerMap(instr); 682 instr = AssignPointerMap(instr);
683 683
684 if (hinstr->HasObservableSideEffects()) { 684 if (hinstr->HasObservableSideEffects() && !hinstr->IsControlInstruction()) {
685 ASSERT(hinstr->next()->IsSimulate()); 685 ASSERT(hinstr->next()->IsSimulate());
686 HSimulate* sim = HSimulate::cast(hinstr->next()); 686 HSimulate* sim = HSimulate::cast(hinstr->next());
687 ASSERT(instruction_pending_deoptimization_environment_ == NULL); 687 ASSERT(instruction_pending_deoptimization_environment_ == NULL);
688 ASSERT(pending_deoptimization_ast_id_.IsNone()); 688 ASSERT(pending_deoptimization_ast_id_.IsNone());
689 instruction_pending_deoptimization_environment_ = instr; 689 instruction_pending_deoptimization_environment_ = instr;
690 pending_deoptimization_ast_id_ = sim->ast_id(); 690 pending_deoptimization_ast_id_ = sim->ast_id();
691 } 691 }
692 692
693 // If instruction does not have side-effects lazy deoptimization 693 // If instruction does not have side-effects lazy deoptimization
694 // after the call will try to deoptimize to the point before the call. 694 // after the call will try to deoptimize to the point before the call.
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 LOperand* global_object = UseTempRegister(instr->global_object()); 1693 LOperand* global_object = UseTempRegister(instr->global_object());
1694 LOperand* scratch = TempRegister(); 1694 LOperand* scratch = TempRegister();
1695 LOperand* scratch2 = TempRegister(); 1695 LOperand* scratch2 = TempRegister();
1696 LOperand* scratch3 = TempRegister(); 1696 LOperand* scratch3 = TempRegister();
1697 LRandom* result = new(zone()) LRandom( 1697 LRandom* result = new(zone()) LRandom(
1698 global_object, scratch, scratch2, scratch3); 1698 global_object, scratch, scratch2, scratch3);
1699 return DefineFixedDouble(result, xmm1); 1699 return DefineFixedDouble(result, xmm1);
1700 } 1700 }
1701 1701
1702 1702
1703 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1703 LInstruction* LChunkBuilder::DoCompareGenericAndBranch(
1704 HCompareGenericAndBranch* instr) {
1704 ASSERT(instr->left()->representation().IsSmiOrTagged()); 1705 ASSERT(instr->left()->representation().IsSmiOrTagged());
1705 ASSERT(instr->right()->representation().IsSmiOrTagged()); 1706 ASSERT(instr->right()->representation().IsSmiOrTagged());
1706 LOperand* context = UseFixed(instr->context(), esi); 1707 LOperand* context = UseFixed(instr->context(), esi);
1707 LOperand* left = UseFixed(instr->left(), edx); 1708 LOperand* left = UseFixed(instr->left(), edx);
1708 LOperand* right = UseFixed(instr->right(), eax); 1709 LOperand* right = UseFixed(instr->right(), eax);
1709 LCmpT* result = new(zone()) LCmpT(context, left, right); 1710 return MarkAsCall(new(zone()) LCompareGenericAndBranch(context, left, right),
1710 return MarkAsCall(DefineFixed(result, eax), instr); 1711 instr);
1711 } 1712 }
1712 1713
1713 1714
1714 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( 1715 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1715 HCompareNumericAndBranch* instr) { 1716 HCompareNumericAndBranch* instr) {
1716 Representation r = instr->representation(); 1717 Representation r = instr->representation();
1717 if (r.IsSmiOrInteger32()) { 1718 if (r.IsSmiOrInteger32()) {
1718 ASSERT(instr->left()->representation().Equals(r)); 1719 ASSERT(instr->left()->representation().Equals(r));
1719 ASSERT(instr->right()->representation().Equals(r)); 1720 ASSERT(instr->right()->representation().Equals(r));
1720 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1721 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2719 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2720 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2720 LOperand* object = UseRegister(instr->object()); 2721 LOperand* object = UseRegister(instr->object());
2721 LOperand* index = UseTempRegister(instr->index()); 2722 LOperand* index = UseTempRegister(instr->index());
2722 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2723 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2723 } 2724 }
2724 2725
2725 2726
2726 } } // namespace v8::internal 2727 } } // namespace v8::internal
2727 2728
2728 #endif // V8_TARGET_ARCH_IA32 2729 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen-instructions.cc ('K') | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698