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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
992 HValue* value = instr->value(); | 992 HValue* value = instr->value(); |
993 if (value->EmitAtUses()) { | 993 if (value->EmitAtUses()) { |
994 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() | 994 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() |
995 ? instr->FirstSuccessor() | 995 ? instr->FirstSuccessor() |
996 : instr->SecondSuccessor(); | 996 : instr->SecondSuccessor(); |
997 return new(zone()) LGoto(successor->block_id()); | 997 return new(zone()) LGoto(successor->block_id()); |
998 } | 998 } |
999 | 999 |
1000 LBranch* result = new(zone()) LBranch(UseRegister(value)); | 1000 LBranch* result = new(zone()) LBranch(UseRegister(value)); |
1001 // Tagged values that are not known smis or booleans require a | 1001 // Tagged values that are not known smis or booleans require a |
1002 // deoptimization environment. | 1002 // deoptimization environment. Except in the Generic case. |
Toon Verwaest
2013/06/20 12:45:59
If the instruction is generic no environment is ne
| |
1003 Representation rep = value->representation(); | 1003 Representation rep = value->representation(); |
1004 HType type = value->type(); | 1004 HType type = value->type(); |
1005 if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) { | 1005 ToBooleanStub::Types expected = instr->expected_input_types(); |
1006 if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean() && | |
1007 !expected.IsGeneric()) { | |
1006 return AssignEnvironment(result); | 1008 return AssignEnvironment(result); |
1007 } | 1009 } |
1008 return result; | 1010 return result; |
1009 } | 1011 } |
1010 | 1012 |
1011 | 1013 |
1012 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { | 1014 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { |
1013 return new(zone()) LDebugBreak(); | 1015 return new(zone()) LDebugBreak(); |
1014 } | 1016 } |
1015 | 1017 |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2651 | 2653 |
2652 | 2654 |
2653 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2655 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2654 LOperand* object = UseRegister(instr->object()); | 2656 LOperand* object = UseRegister(instr->object()); |
2655 LOperand* index = UseRegister(instr->index()); | 2657 LOperand* index = UseRegister(instr->index()); |
2656 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2658 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2657 } | 2659 } |
2658 | 2660 |
2659 | 2661 |
2660 } } // namespace v8::internal | 2662 } } // namespace v8::internal |
OLD | NEW |