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

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

Issue 5990005: Optimize instanceof further... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/lithium-allocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 bool needs_environment = 826 bool needs_environment =
827 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || !hinstr->HasSideEffects(); 827 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || !hinstr->HasSideEffects();
828 if (needs_environment && !instr->HasEnvironment()) { 828 if (needs_environment && !instr->HasEnvironment()) {
829 instr = AssignEnvironment(instr); 829 instr = AssignEnvironment(instr);
830 } 830 }
831 831
832 return instr; 832 return instr;
833 } 833 }
834 834
835 835
836 LInstruction* LChunkBuilder::MarkAsSaveDoubles(LInstruction* instr) {
837 allocator_->MarkAsSaveDoubles();
838 return instr;
839 }
840
841
836 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { 842 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
837 ASSERT(!instr->HasPointerMap()); 843 ASSERT(!instr->HasPointerMap());
838 instr->set_pointer_map(new LPointerMap(position_)); 844 instr->set_pointer_map(new LPointerMap(position_));
839 return instr; 845 return instr;
840 } 846 }
841 847
842 848
843 LInstruction* LChunkBuilder::Define(LInstruction* instr, LUnallocated* result) { 849 LInstruction* LChunkBuilder::Define(LInstruction* instr, LUnallocated* result) {
844 allocator_->RecordDefinition(current_instruction_, result); 850 allocator_->RecordDefinition(current_instruction_, result);
845 instr->set_result(result); 851 instr->set_result(result);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 second_id); 1256 second_id);
1251 } else if (v->IsCompareJSObjectEq()) { 1257 } else if (v->IsCompareJSObjectEq()) {
1252 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); 1258 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
1253 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), 1259 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
1254 UseRegisterAtStart(compare->right()), 1260 UseRegisterAtStart(compare->right()),
1255 first_id, 1261 first_id,
1256 second_id); 1262 second_id);
1257 } else if (v->IsInstanceOf()) { 1263 } else if (v->IsInstanceOf()) {
1258 HInstanceOf* instance_of = HInstanceOf::cast(v); 1264 HInstanceOf* instance_of = HInstanceOf::cast(v);
1259 LInstruction* result = 1265 LInstruction* result =
1260 new LInstanceOfAndBranch(UseFixed(instance_of->left(), eax), 1266 new LInstanceOfAndBranch(
1261 UseFixed(instance_of->right(), edx), 1267 UseFixed(instance_of->left(), InstanceofStub::left()),
1262 first_id, 1268 UseFixed(instance_of->right(), InstanceofStub::right()),
1263 second_id); 1269 first_id,
1270 second_id);
1264 return MarkAsCall(result, instr); 1271 return MarkAsCall(result, instr);
1265 } else if (v->IsTypeofIs()) { 1272 } else if (v->IsTypeofIs()) {
1266 HTypeofIs* typeof_is = HTypeofIs::cast(v); 1273 HTypeofIs* typeof_is = HTypeofIs::cast(v);
1267 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()), 1274 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()),
1268 first_id, 1275 first_id,
1269 second_id); 1276 second_id);
1270 } else { 1277 } else {
1271 if (v->IsConstant()) { 1278 if (v->IsConstant()) {
1272 if (HConstant::cast(v)->handle()->IsTrue()) { 1279 if (HConstant::cast(v)->handle()->IsTrue()) {
1273 return new LGoto(first_id); 1280 return new LGoto(first_id);
(...skipping 27 matching lines...) Expand all
1301 } 1308 }
1302 1309
1303 1310
1304 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { 1311 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
1305 return DefineAsRegister(new LArgumentsElements); 1312 return DefineAsRegister(new LArgumentsElements);
1306 } 1313 }
1307 1314
1308 1315
1309 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { 1316 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1310 LInstruction* result = 1317 LInstruction* result =
1311 new LInstanceOf(UseFixed(instr->left(), eax), 1318 new LInstanceOf(UseFixed(instr->left(), InstanceofStub::left()),
1312 UseFixed(instr->right(), edx)); 1319 UseFixed(instr->right(), InstanceofStub::right()));
1313 return MarkAsCall(DefineFixed(result, eax), instr); 1320 return MarkAsCall(DefineFixed(result, eax), instr);
1314 } 1321 }
1315 1322
1316 1323
1324 LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
1325 HInstanceOfKnownGlobal* instr) {
1326 LInstruction* result =
1327 new LInstanceOfKnownGlobal(
1328 UseFixed(instr->value(), InstanceofStub::left()),
1329 FixedTemp(edi));
1330 MarkAsSaveDoubles(result);
1331 return AssignEnvironment(AssignPointerMap(DefineFixed(result, eax)));
1332 }
1333
1334
1317 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { 1335 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1318 LOperand* function = UseFixed(instr->function(), edi); 1336 LOperand* function = UseFixed(instr->function(), edi);
1319 LOperand* receiver = UseFixed(instr->receiver(), eax); 1337 LOperand* receiver = UseFixed(instr->receiver(), eax);
1320 LOperand* length = UseRegisterAtStart(instr->length()); 1338 LOperand* length = UseRegisterAtStart(instr->length());
1321 LOperand* elements = UseRegisterAtStart(instr->elements()); 1339 LOperand* elements = UseRegisterAtStart(instr->elements());
1322 LInstruction* result = new LApplyArguments(function, 1340 LInstruction* result = new LApplyArguments(function,
1323 receiver, 1341 receiver,
1324 length, 1342 length,
1325 elements); 1343 elements);
1326 return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY); 1344 return MarkAsCall(DefineFixed(result, eax), instr, CAN_DEOPTIMIZE_EAGERLY);
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 void LPointerMap::PrintTo(StringStream* stream) const { 2126 void LPointerMap::PrintTo(StringStream* stream) const {
2109 stream->Add("{"); 2127 stream->Add("{");
2110 for (int i = 0; i < pointer_operands_.length(); ++i) { 2128 for (int i = 0; i < pointer_operands_.length(); ++i) {
2111 if (i != 0) stream->Add(";"); 2129 if (i != 0) stream->Add(";");
2112 pointer_operands_[i]->PrintTo(stream); 2130 pointer_operands_[i]->PrintTo(stream);
2113 } 2131 }
2114 stream->Add("} @%d", position()); 2132 stream->Add("} @%d", position());
2115 } 2133 }
2116 2134
2117 } } // namespace v8::internal 2135 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/lithium-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698