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

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

Issue 7497063: Simplify and optimize ToBoolean handling. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 4 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/apinatives.js ('K') | « src/x64/lithium-codegen-x64.cc ('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 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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 1029 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
1030 HValue* v = instr->value(); 1030 HValue* v = instr->value();
1031 if (v->EmitAtUses()) { 1031 if (v->EmitAtUses()) {
1032 ASSERT(v->IsConstant()); 1032 ASSERT(v->IsConstant());
1033 ASSERT(!v->representation().IsDouble()); 1033 ASSERT(!v->representation().IsDouble());
1034 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() 1034 HBasicBlock* successor = HConstant::cast(v)->ToBoolean()
1035 ? instr->FirstSuccessor() 1035 ? instr->FirstSuccessor()
1036 : instr->SecondSuccessor(); 1036 : instr->SecondSuccessor();
1037 return new LGoto(successor->block_id()); 1037 return new LGoto(successor->block_id());
1038 } 1038 }
1039 LInstruction* branch = new LBranch(UseRegister(v)); 1039 return AssignEnvironment(new LBranch(UseRegister(v)));
1040 // When we handle all cases, we never deopt, so we don't need to assign the
1041 // environment then.
1042 bool all_cases_handled = instr->expected_input_types().IsAll();
1043 return all_cases_handled ? branch : AssignEnvironment(branch);
1044 } 1040 }
1045 1041
1046 1042
1047 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 1043 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1048 ASSERT(instr->value()->representation().IsTagged()); 1044 ASSERT(instr->value()->representation().IsTagged());
1049 LOperand* value = UseRegisterAtStart(instr->value()); 1045 LOperand* value = UseRegisterAtStart(instr->value());
1050 return new LCmpMapAndBranch(value); 1046 return new LCmpMapAndBranch(value);
1051 } 1047 }
1052 1048
1053 1049
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 LOperand* key = UseOrConstantAtStart(instr->key()); 2173 LOperand* key = UseOrConstantAtStart(instr->key());
2178 LOperand* object = UseOrConstantAtStart(instr->object()); 2174 LOperand* object = UseOrConstantAtStart(instr->object());
2179 LIn* result = new LIn(key, object); 2175 LIn* result = new LIn(key, object);
2180 return MarkAsCall(DefineFixed(result, rax), instr); 2176 return MarkAsCall(DefineFixed(result, rax), instr);
2181 } 2177 }
2182 2178
2183 2179
2184 } } // namespace v8::internal 2180 } } // namespace v8::internal
2185 2181
2186 #endif // V8_TARGET_ARCH_X64 2182 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/apinatives.js ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698