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

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

Issue 5828004: IA32: Optimize instanceof... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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 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 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 second_id); 1271 second_id);
1272 } else if (v->IsCompareJSObjectEq()) { 1272 } else if (v->IsCompareJSObjectEq()) {
1273 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v); 1273 HCompareJSObjectEq* compare = HCompareJSObjectEq::cast(v);
1274 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()), 1274 return new LCmpJSObjectEqAndBranch(UseRegisterAtStart(compare->left()),
1275 UseRegisterAtStart(compare->right()), 1275 UseRegisterAtStart(compare->right()),
1276 first_id, 1276 first_id,
1277 second_id); 1277 second_id);
1278 } else if (v->IsInstanceOf()) { 1278 } else if (v->IsInstanceOf()) {
1279 HInstanceOf* instance_of = HInstanceOf::cast(v); 1279 HInstanceOf* instance_of = HInstanceOf::cast(v);
1280 LInstruction* result = 1280 LInstruction* result =
1281 new LInstanceOfAndBranch(Use(instance_of->left()), 1281 new LInstanceOfAndBranch(UseFixed(instance_of->left(), eax),
1282 Use(instance_of->right()), 1282 UseFixed(instance_of->right(), edx),
1283 first_id, 1283 first_id,
1284 second_id); 1284 second_id);
1285 return MarkAsCall(result, instr); 1285 return MarkAsCall(result, instr);
1286 } else if (v->IsTypeofIs()) { 1286 } else if (v->IsTypeofIs()) {
1287 HTypeofIs* typeof_is = HTypeofIs::cast(v); 1287 HTypeofIs* typeof_is = HTypeofIs::cast(v);
1288 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()), 1288 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()),
1289 first_id, 1289 first_id,
1290 second_id); 1290 second_id);
1291 } else { 1291 } else {
1292 if (v->IsConstant()) { 1292 if (v->IsConstant()) {
(...skipping 29 matching lines...) Expand all
1322 } 1322 }
1323 1323
1324 1324
1325 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { 1325 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
1326 return DefineAsRegister(new LArgumentsElements); 1326 return DefineAsRegister(new LArgumentsElements);
1327 } 1327 }
1328 1328
1329 1329
1330 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { 1330 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1331 LInstruction* result = 1331 LInstruction* result =
1332 new LInstanceOf(Use(instr->left()), Use(instr->right())); 1332 new LInstanceOf(UseFixed(instr->left(), eax),
1333 UseFixed(instr->right(), edx));
1333 return MarkAsCall(DefineFixed(result, eax), instr); 1334 return MarkAsCall(DefineFixed(result, eax), instr);
1334 } 1335 }
1335 1336
1336 1337
1337 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { 1338 LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
1338 LOperand* function = UseFixed(instr->function(), edi); 1339 LOperand* function = UseFixed(instr->function(), edi);
1339 LOperand* receiver = UseFixed(instr->receiver(), eax); 1340 LOperand* receiver = UseFixed(instr->receiver(), eax);
1340 LOperand* length = UseRegisterAtStart(instr->length()); 1341 LOperand* length = UseRegisterAtStart(instr->length());
1341 LOperand* elements = UseRegisterAtStart(instr->elements()); 1342 LOperand* elements = UseRegisterAtStart(instr->elements());
1342 LInstruction* result = new LApplyArguments(function, 1343 LInstruction* result = new LApplyArguments(function,
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 void LPointerMap::PrintTo(StringStream* stream) const { 2132 void LPointerMap::PrintTo(StringStream* stream) const {
2132 stream->Add("{"); 2133 stream->Add("{");
2133 for (int i = 0; i < pointer_operands_.length(); ++i) { 2134 for (int i = 0; i < pointer_operands_.length(); ++i) {
2134 if (i != 0) stream->Add(";"); 2135 if (i != 0) stream->Add(";");
2135 pointer_operands_[i]->PrintTo(stream); 2136 pointer_operands_[i]->PrintTo(stream);
2136 } 2137 }
2137 stream->Add("} @%d", position()); 2138 stream->Add("} @%d", position());
2138 } 2139 }
2139 2140
2140 } } // namespace v8::internal 2141 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/v8-counters.h » ('j') | src/v8-counters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698