OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { | 1034 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
1035 HValue* v = instr->value(); | 1035 HValue* v = instr->value(); |
1036 if (v->EmitAtUses()) { | 1036 if (v->EmitAtUses()) { |
1037 ASSERT(v->IsConstant()); | 1037 ASSERT(v->IsConstant()); |
1038 ASSERT(!v->representation().IsDouble()); | 1038 ASSERT(!v->representation().IsDouble()); |
1039 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() | 1039 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() |
1040 ? instr->FirstSuccessor() | 1040 ? instr->FirstSuccessor() |
1041 : instr->SecondSuccessor(); | 1041 : instr->SecondSuccessor(); |
1042 return new LGoto(successor->block_id()); | 1042 return new LGoto(successor->block_id()); |
1043 } | 1043 } |
1044 return new LBranch(UseRegisterAtStart(v)); | 1044 ToBooleanStub::Types expected = instr->expected_input_types(); |
| 1045 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); |
| 1046 LOperand* temp = needs_temp ? TempRegister() : NULL; |
| 1047 return AssignEnvironment(new LBranch(UseRegister(v), temp)); |
1045 } | 1048 } |
1046 | 1049 |
1047 | 1050 |
1048 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1051 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
1049 ASSERT(instr->value()->representation().IsTagged()); | 1052 ASSERT(instr->value()->representation().IsTagged()); |
1050 LOperand* value = UseRegisterAtStart(instr->value()); | 1053 LOperand* value = UseRegisterAtStart(instr->value()); |
1051 return new LCmpMapAndBranch(value); | 1054 return new LCmpMapAndBranch(value); |
1052 } | 1055 } |
1053 | 1056 |
1054 | 1057 |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2256 LOperand* key = UseOrConstantAtStart(instr->key()); | 2259 LOperand* key = UseOrConstantAtStart(instr->key()); |
2257 LOperand* object = UseOrConstantAtStart(instr->object()); | 2260 LOperand* object = UseOrConstantAtStart(instr->object()); |
2258 LIn* result = new LIn(context, key, object); | 2261 LIn* result = new LIn(context, key, object); |
2259 return MarkAsCall(DefineFixed(result, eax), instr); | 2262 return MarkAsCall(DefineFixed(result, eax), instr); |
2260 } | 2263 } |
2261 | 2264 |
2262 | 2265 |
2263 } } // namespace v8::internal | 2266 } } // namespace v8::internal |
2264 | 2267 |
2265 #endif // V8_TARGET_ARCH_IA32 | 2268 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |