| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 ASSERT(value->IsConstant()); | 1007 ASSERT(value->IsConstant()); |
| 1008 ASSERT(!value->representation().IsDouble()); | 1008 ASSERT(!value->representation().IsDouble()); |
| 1009 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() | 1009 HBasicBlock* successor = HConstant::cast(value)->BooleanValue() |
| 1010 ? instr->FirstSuccessor() | 1010 ? instr->FirstSuccessor() |
| 1011 : instr->SecondSuccessor(); | 1011 : instr->SecondSuccessor(); |
| 1012 return new(zone()) LGoto(successor->block_id()); | 1012 return new(zone()) LGoto(successor->block_id()); |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 LBranch* result = new(zone()) LBranch(UseRegister(value)); | 1015 LBranch* result = new(zone()) LBranch(UseRegister(value)); |
| 1016 // Tagged values that are not known smis or booleans require a | 1016 // Tagged values that are not known smis or booleans require a |
| 1017 // deoptimization environment. | 1017 // deoptimization environment. Except in the Generic case. |
| 1018 ToBooleanStub::Types expected = instr->expected_input_types(); |
| 1018 Representation rep = value->representation(); | 1019 Representation rep = value->representation(); |
| 1019 HType type = value->type(); | 1020 HType type = value->type(); |
| 1020 if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) { | 1021 if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean() && |
| 1022 !expected.IsGeneric()) { |
| 1021 return AssignEnvironment(result); | 1023 return AssignEnvironment(result); |
| 1022 } | 1024 } |
| 1023 return result; | 1025 return result; |
| 1024 } | 1026 } |
| 1025 | 1027 |
| 1026 | 1028 |
| 1027 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1029 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
| 1028 ASSERT(instr->value()->representation().IsTagged()); | 1030 ASSERT(instr->value()->representation().IsTagged()); |
| 1029 LOperand* value = UseRegisterAtStart(instr->value()); | 1031 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1030 return new(zone()) LCmpMapAndBranch(value); | 1032 return new(zone()) LCmpMapAndBranch(value); |
| (...skipping 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2591 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2593 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2592 LOperand* object = UseRegister(instr->object()); | 2594 LOperand* object = UseRegister(instr->object()); |
| 2593 LOperand* index = UseTempRegister(instr->index()); | 2595 LOperand* index = UseTempRegister(instr->index()); |
| 2594 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2596 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2595 } | 2597 } |
| 2596 | 2598 |
| 2597 | 2599 |
| 2598 } } // namespace v8::internal | 2600 } } // namespace v8::internal |
| 2599 | 2601 |
| 2600 #endif // V8_TARGET_ARCH_X64 | 2602 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |