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

Side by Side Diff: src/ia32/lithium-ia32.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
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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ToBooleanStub::Types expected = instr->expected_input_types(); 1044 ToBooleanStub::Types expected = instr->expected_input_types();
1045 // We need a temporary register when we have to access the map *or* we have 1045 // We need a temporary register when we have to access the map *or* we have
1046 // no type info yet, in which case we handle all cases (including the ones 1046 // no type info yet, in which case we handle all cases (including the ones
1047 // involving maps). 1047 // involving maps).
1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty(); 1048 bool needs_temp = expected.NeedsMap() || expected.IsEmpty();
1049 LOperand* temp = needs_temp ? TempRegister() : NULL; 1049 LOperand* temp = needs_temp ? TempRegister() : NULL;
1050 LInstruction* branch = new LBranch(UseRegister(v), temp); 1050 return AssignEnvironment(new LBranch(UseRegister(v), temp));
1051 // When we handle all cases, we never deopt, so we don't need to assign the
1052 // environment then.
1053 return expected.IsAll() ? branch : AssignEnvironment(branch);
1054 } 1051 }
1055 1052
1056 1053
1057 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 1054 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1058 ASSERT(instr->value()->representation().IsTagged()); 1055 ASSERT(instr->value()->representation().IsTagged());
1059 LOperand* value = UseRegisterAtStart(instr->value()); 1056 LOperand* value = UseRegisterAtStart(instr->value());
1060 return new LCmpMapAndBranch(value); 1057 return new LCmpMapAndBranch(value);
1061 } 1058 }
1062 1059
1063 1060
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 LOperand* key = UseOrConstantAtStart(instr->key()); 2262 LOperand* key = UseOrConstantAtStart(instr->key());
2266 LOperand* object = UseOrConstantAtStart(instr->object()); 2263 LOperand* object = UseOrConstantAtStart(instr->object());
2267 LIn* result = new LIn(context, key, object); 2264 LIn* result = new LIn(context, key, object);
2268 return MarkAsCall(DefineFixed(result, eax), instr); 2265 return MarkAsCall(DefineFixed(result, eax), instr);
2269 } 2266 }
2270 2267
2271 2268
2272 } } // namespace v8::internal 2269 } } // namespace v8::internal
2273 2270
2274 #endif // V8_TARGET_ARCH_IA32 2271 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698