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

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

Issue 15763004: Replace tagged keys for fast access by smi, and use smi in boundscheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed comment Created 7 years, 7 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/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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 return AssignEnvironment(result); 1940 return AssignEnvironment(result);
1941 } 1941 }
1942 1942
1943 1943
1944 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { 1944 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
1945 LOperand* value = UseRegisterAtStart(instr->value()); 1945 LOperand* value = UseRegisterAtStart(instr->value());
1946 return AssignEnvironment(new(zone()) LCheckSmi(value)); 1946 return AssignEnvironment(new(zone()) LCheckSmi(value));
1947 } 1947 }
1948 1948
1949 1949
1950 LInstruction* LChunkBuilder::DoCheckSmiOrInt32(HCheckSmiOrInt32* instr) {
1951 LOperand* value = UseRegisterAtStart(instr->value());
1952 return AssignEnvironment(new(zone()) LCheckSmi(value));
1953 }
1954
1955
1956 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { 1950 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
1957 LOperand* value = UseRegisterAtStart(instr->value()); 1951 LOperand* value = UseRegisterAtStart(instr->value());
1958 return AssignEnvironment(new(zone()) LCheckFunction(value)); 1952 return AssignEnvironment(new(zone()) LCheckFunction(value));
1959 } 1953 }
1960 1954
1961 1955
1962 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { 1956 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
1963 LOperand* value = UseRegisterAtStart(instr->value()); 1957 LOperand* value = UseRegisterAtStart(instr->value());
1964 LCheckMaps* result = new(zone()) LCheckMaps(value); 1958 LCheckMaps* result = new(zone()) LCheckMaps(value);
1965 return AssignEnvironment(result); 1959 return AssignEnvironment(result);
(...skipping 26 matching lines...) Expand all
1992 } 1986 }
1993 1987
1994 1988
1995 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { 1989 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
1996 Representation r = instr->representation(); 1990 Representation r = instr->representation();
1997 if (r.IsInteger32()) { 1991 if (r.IsInteger32()) {
1998 return DefineAsRegister(new(zone()) LConstantI); 1992 return DefineAsRegister(new(zone()) LConstantI);
1999 } else if (r.IsDouble()) { 1993 } else if (r.IsDouble()) {
2000 LOperand* temp = TempRegister(); 1994 LOperand* temp = TempRegister();
2001 return DefineAsRegister(new(zone()) LConstantD(temp)); 1995 return DefineAsRegister(new(zone()) LConstantD(temp));
2002 } else if (r.IsTagged()) { 1996 } else if (r.IsSmiOrTagged()) {
2003 return DefineAsRegister(new(zone()) LConstantT); 1997 return DefineAsRegister(new(zone()) LConstantT);
2004 } else { 1998 } else {
2005 UNREACHABLE(); 1999 UNREACHABLE();
2006 return NULL; 2000 return NULL;
2007 } 2001 }
2008 } 2002 }
2009 2003
2010 2004
2011 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2005 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
2012 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; 2006 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 2101
2108 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( 2102 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
2109 HLoadExternalArrayPointer* instr) { 2103 HLoadExternalArrayPointer* instr) {
2110 LOperand* input = UseRegisterAtStart(instr->value()); 2104 LOperand* input = UseRegisterAtStart(instr->value());
2111 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); 2105 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input));
2112 } 2106 }
2113 2107
2114 2108
2115 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2109 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2116 ASSERT(instr->key()->representation().IsInteger32() || 2110 ASSERT(instr->key()->representation().IsInteger32() ||
2117 instr->key()->representation().IsTagged()); 2111 instr->key()->representation().IsSmi());
2118 ElementsKind elements_kind = instr->elements_kind(); 2112 ElementsKind elements_kind = instr->elements_kind();
2119 bool clobbers_key = instr->key()->representation().IsTagged(); 2113 bool clobbers_key = instr->key()->representation().IsSmi();
2120 LOperand* key = clobbers_key 2114 LOperand* key = clobbers_key
2121 ? UseTempRegister(instr->key()) 2115 ? UseTempRegister(instr->key())
2122 : UseRegisterOrConstantAtStart(instr->key()); 2116 : UseRegisterOrConstantAtStart(instr->key());
2123 LLoadKeyed* result = NULL; 2117 LLoadKeyed* result = NULL;
2124 2118
2125 if (!instr->is_external()) { 2119 if (!instr->is_external()) {
2126 LOperand* obj = UseRegisterAtStart(instr->elements()); 2120 LOperand* obj = UseRegisterAtStart(instr->elements());
2127 result = new(zone()) LLoadKeyed(obj, key); 2121 result = new(zone()) LLoadKeyed(obj, key);
2128 } else { 2122 } else {
2129 ASSERT( 2123 ASSERT(
(...skipping 20 matching lines...) Expand all
2150 LOperand* object = UseFixed(instr->object(), rdx); 2144 LOperand* object = UseFixed(instr->object(), rdx);
2151 LOperand* key = UseFixed(instr->key(), rax); 2145 LOperand* key = UseFixed(instr->key(), rax);
2152 2146
2153 LLoadKeyedGeneric* result = new(zone()) LLoadKeyedGeneric(object, key); 2147 LLoadKeyedGeneric* result = new(zone()) LLoadKeyedGeneric(object, key);
2154 return MarkAsCall(DefineFixed(result, rax), instr); 2148 return MarkAsCall(DefineFixed(result, rax), instr);
2155 } 2149 }
2156 2150
2157 2151
2158 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2152 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2159 ElementsKind elements_kind = instr->elements_kind(); 2153 ElementsKind elements_kind = instr->elements_kind();
2160 bool clobbers_key = instr->key()->representation().IsTagged(); 2154 bool clobbers_key = instr->key()->representation().IsSmi();
2161 2155
2162 if (!instr->is_external()) { 2156 if (!instr->is_external()) {
2163 ASSERT(instr->elements()->representation().IsTagged()); 2157 ASSERT(instr->elements()->representation().IsTagged());
2164 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2158 bool needs_write_barrier = instr->NeedsWriteBarrier();
2165 LOperand* object = NULL; 2159 LOperand* object = NULL;
2166 LOperand* key = NULL; 2160 LOperand* key = NULL;
2167 LOperand* val = NULL; 2161 LOperand* val = NULL;
2168 2162
2169 if (instr->value()->representation().IsDouble()) { 2163 if (instr->value()->representation().IsDouble()) {
2170 object = UseRegisterAtStart(instr->elements()); 2164 object = UseRegisterAtStart(instr->elements());
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2584 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2591 LOperand* object = UseRegister(instr->object()); 2585 LOperand* object = UseRegister(instr->object());
2592 LOperand* index = UseTempRegister(instr->index()); 2586 LOperand* index = UseTempRegister(instr->index());
2593 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2587 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2594 } 2588 }
2595 2589
2596 2590
2597 } } // namespace v8::internal 2591 } } // namespace v8::internal
2598 2592
2599 #endif // V8_TARGET_ARCH_X64 2593 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698