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/ia32/lithium-ia32.cc

Issue 5961016: Optimize array-length and fast element loads.... (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') | 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 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 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 1670
1671 1671
1672 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { 1672 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) {
1673 ASSERT(instr->value()->representation().IsTagged()); 1673 ASSERT(instr->value()->representation().IsTagged());
1674 LOperand* value = UseTempRegister(instr->value()); 1674 LOperand* value = UseTempRegister(instr->value());
1675 1675
1676 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); 1676 return DefineSameAsFirst(new LClassOfTest(value, TempRegister()));
1677 } 1677 }
1678 1678
1679 1679
1680 LInstruction* LChunkBuilder::DoArrayLength(HArrayLength* instr) { 1680 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1681 LOperand* array = NULL; 1681 LOperand* array = UseRegisterAtStart(instr->value());
1682 LOperand* temporary = NULL; 1682 return DefineAsRegister(new LJSArrayLength(array));
1683
1684 if (instr->value()->IsLoadElements()) {
1685 array = UseRegisterAtStart(instr->value());
1686 } else {
1687 array = UseRegister(instr->value());
1688 temporary = TempRegister();
1689 }
1690
1691 LInstruction* result = new LArrayLength(array, temporary);
1692 return AssignEnvironment(DefineAsRegister(result));
1693 } 1683 }
1694 1684
1695 1685
1686 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
1687 LOperand* array = UseRegisterAtStart(instr->value());
1688 return DefineAsRegister(new LFixedArrayLength(array));
1689 }
1690
1691
1696 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { 1692 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1697 LOperand* object = UseRegister(instr->value()); 1693 LOperand* object = UseRegister(instr->value());
1698 LInstruction* result = new LValueOf(object, TempRegister()); 1694 LInstruction* result = new LValueOf(object, TempRegister());
1699 return AssignEnvironment(DefineSameAsFirst(result)); 1695 return AssignEnvironment(DefineSameAsFirst(result));
1700 } 1696 }
1701 1697
1702 1698
1703 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { 1699 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1704 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), 1700 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()),
1705 Use(instr->length()))); 1701 Use(instr->length())));
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 void LPointerMap::PrintTo(StringStream* stream) const { 2123 void LPointerMap::PrintTo(StringStream* stream) const {
2128 stream->Add("{"); 2124 stream->Add("{");
2129 for (int i = 0; i < pointer_operands_.length(); ++i) { 2125 for (int i = 0; i < pointer_operands_.length(); ++i) {
2130 if (i != 0) stream->Add(";"); 2126 if (i != 0) stream->Add(";");
2131 pointer_operands_[i]->PrintTo(stream); 2127 pointer_operands_[i]->PrintTo(stream);
2132 } 2128 }
2133 stream->Add("} @%d", position()); 2129 stream->Add("} @%d", position());
2134 } 2130 }
2135 2131
2136 } } // namespace v8::internal 2132 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698