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

Side by Side Diff: src/ia32/lithium-ia32.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/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.cc » ('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 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 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 return AssignEnvironment(result); 2062 return AssignEnvironment(result);
2063 } 2063 }
2064 2064
2065 2065
2066 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { 2066 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
2067 LOperand* value = UseAtStart(instr->value()); 2067 LOperand* value = UseAtStart(instr->value());
2068 return AssignEnvironment(new(zone()) LCheckSmi(value)); 2068 return AssignEnvironment(new(zone()) LCheckSmi(value));
2069 } 2069 }
2070 2070
2071 2071
2072 LInstruction* LChunkBuilder::DoCheckSmiOrInt32(HCheckSmiOrInt32* instr) {
2073 LOperand* value = UseAtStart(instr->value());
2074 return AssignEnvironment(new(zone()) LCheckSmi(value));
2075 }
2076
2077
2078 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { 2072 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) {
2079 // If the target is in new space, we'll emit a global cell compare and so 2073 // If the target is in new space, we'll emit a global cell compare and so
2080 // want the value in a register. If the target gets promoted before we 2074 // want the value in a register. If the target gets promoted before we
2081 // emit code, we will still get the register but will do an immediate 2075 // emit code, we will still get the register but will do an immediate
2082 // compare instead of the cell compare. This is safe. 2076 // compare instead of the cell compare. This is safe.
2083 LOperand* value = instr->target_in_new_space() 2077 LOperand* value = instr->target_in_new_space()
2084 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); 2078 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value());
2085 return AssignEnvironment(new(zone()) LCheckFunction(value)); 2079 return AssignEnvironment(new(zone()) LCheckFunction(value));
2086 } 2080 }
2087 2081
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 return DefineAsRegister(new(zone()) LConstantI); 2132 return DefineAsRegister(new(zone()) LConstantI);
2139 } else if (r.IsDouble()) { 2133 } else if (r.IsDouble()) {
2140 double value = instr->DoubleValue(); 2134 double value = instr->DoubleValue();
2141 bool value_is_zero = BitCast<uint64_t, double>(value) == 0; 2135 bool value_is_zero = BitCast<uint64_t, double>(value) == 0;
2142 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 2136 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
2143 LOperand* temp = value_is_zero ? NULL : TempRegister(); 2137 LOperand* temp = value_is_zero ? NULL : TempRegister();
2144 return DefineAsRegister(new(zone()) LConstantD(temp)); 2138 return DefineAsRegister(new(zone()) LConstantD(temp));
2145 } else { 2139 } else {
2146 return DefineX87TOS(new(zone()) LConstantD(NULL)); 2140 return DefineX87TOS(new(zone()) LConstantD(NULL));
2147 } 2141 }
2148 } else if (r.IsTagged()) { 2142 } else if (r.IsSmiOrTagged()) {
2149 return DefineAsRegister(new(zone()) LConstantT); 2143 return DefineAsRegister(new(zone()) LConstantT);
2150 } else { 2144 } else {
2151 UNREACHABLE(); 2145 UNREACHABLE();
2152 return NULL; 2146 return NULL;
2153 } 2147 }
2154 } 2148 }
2155 2149
2156 2150
2157 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { 2151 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
2158 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; 2152 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2255 2249
2256 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( 2250 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
2257 HLoadExternalArrayPointer* instr) { 2251 HLoadExternalArrayPointer* instr) {
2258 LOperand* input = UseRegisterAtStart(instr->value()); 2252 LOperand* input = UseRegisterAtStart(instr->value());
2259 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); 2253 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input));
2260 } 2254 }
2261 2255
2262 2256
2263 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2257 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2264 ASSERT(instr->key()->representation().IsInteger32() || 2258 ASSERT(instr->key()->representation().IsInteger32() ||
2265 instr->key()->representation().IsTagged()); 2259 instr->key()->representation().IsSmi());
2266 ElementsKind elements_kind = instr->elements_kind(); 2260 ElementsKind elements_kind = instr->elements_kind();
2267 bool clobbers_key = ExternalArrayOpRequiresTemp( 2261 bool clobbers_key = ExternalArrayOpRequiresTemp(
2268 instr->key()->representation(), elements_kind); 2262 instr->key()->representation(), elements_kind);
2269 LOperand* key = clobbers_key 2263 LOperand* key = clobbers_key
2270 ? UseTempRegister(instr->key()) 2264 ? UseTempRegister(instr->key())
2271 : UseRegisterOrConstantAtStart(instr->key()); 2265 : UseRegisterOrConstantAtStart(instr->key());
2272 LLoadKeyed* result = NULL; 2266 LLoadKeyed* result = NULL;
2273 2267
2274 if (!instr->is_external()) { 2268 if (!instr->is_external()) {
2275 LOperand* obj = UseRegisterAtStart(instr->elements()); 2269 LOperand* obj = UseRegisterAtStart(instr->elements());
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 } 2318 }
2325 2319
2326 return UseRegister(instr->value()); 2320 return UseRegister(instr->value());
2327 } 2321 }
2328 2322
2329 2323
2330 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2324 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2331 if (!instr->is_external()) { 2325 if (!instr->is_external()) {
2332 ASSERT(instr->elements()->representation().IsTagged()); 2326 ASSERT(instr->elements()->representation().IsTagged());
2333 ASSERT(instr->key()->representation().IsInteger32() || 2327 ASSERT(instr->key()->representation().IsInteger32() ||
2334 instr->key()->representation().IsTagged()); 2328 instr->key()->representation().IsSmi());
2335 2329
2336 if (instr->value()->representation().IsDouble()) { 2330 if (instr->value()->representation().IsDouble()) {
2337 LOperand* object = UseRegisterAtStart(instr->elements()); 2331 LOperand* object = UseRegisterAtStart(instr->elements());
2338 LOperand* val = NULL; 2332 LOperand* val = NULL;
2339 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 2333 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
2340 val = UseRegisterAtStart(instr->value()); 2334 val = UseRegisterAtStart(instr->value());
2341 } else if (!instr->IsConstantHoleStore()) { 2335 } else if (!instr->IsConstantHoleStore()) {
2342 val = UseX87TopOfStack(instr->value()); 2336 val = UseX87TopOfStack(instr->value());
2343 } 2337 }
2344 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2338 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
2799 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2793 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2800 LOperand* object = UseRegister(instr->object()); 2794 LOperand* object = UseRegister(instr->object());
2801 LOperand* index = UseTempRegister(instr->index()); 2795 LOperand* index = UseTempRegister(instr->index());
2802 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2796 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2803 } 2797 }
2804 2798
2805 2799
2806 } } // namespace v8::internal 2800 } } // namespace v8::internal
2807 2801
2808 #endif // V8_TARGET_ARCH_IA32 2802 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698