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

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

Issue 143633007: A64: Synchronize with r18764. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/ia32/macro-assembler-ia32.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 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 } 2065 }
2066 2066
2067 2067
2068 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { 2068 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
2069 LStoreGlobalCell* result = 2069 LStoreGlobalCell* result =
2070 new(zone()) LStoreGlobalCell(UseRegister(instr->value())); 2070 new(zone()) LStoreGlobalCell(UseRegister(instr->value()));
2071 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2071 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2072 } 2072 }
2073 2073
2074 2074
2075 LInstruction* LChunkBuilder::DoStoreGlobalGeneric(HStoreGlobalGeneric* instr) {
2076 LOperand* context = UseFixed(instr->context(), esi);
2077 LOperand* global_object = UseFixed(instr->global_object(), edx);
2078 LOperand* value = UseFixed(instr->value(), eax);
2079 LStoreGlobalGeneric* result =
2080 new(zone()) LStoreGlobalGeneric(context, global_object, value);
2081 return MarkAsCall(result, instr);
2082 }
2083
2084
2085 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { 2075 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
2086 LOperand* context = UseRegisterAtStart(instr->value()); 2076 LOperand* context = UseRegisterAtStart(instr->value());
2087 LInstruction* result = 2077 LInstruction* result =
2088 DefineAsRegister(new(zone()) LLoadContextSlot(context)); 2078 DefineAsRegister(new(zone()) LLoadContextSlot(context));
2089 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2079 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2090 } 2080 }
2091 2081
2092 2082
2093 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) { 2083 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
2094 LOperand* value; 2084 LOperand* value;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2136 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2147 ASSERT(instr->key()->representation().IsSmiOrInteger32()); 2137 ASSERT(instr->key()->representation().IsSmiOrInteger32());
2148 ElementsKind elements_kind = instr->elements_kind(); 2138 ElementsKind elements_kind = instr->elements_kind();
2149 bool clobbers_key = ExternalArrayOpRequiresTemp( 2139 bool clobbers_key = ExternalArrayOpRequiresTemp(
2150 instr->key()->representation(), elements_kind); 2140 instr->key()->representation(), elements_kind);
2151 LOperand* key = clobbers_key 2141 LOperand* key = clobbers_key
2152 ? UseTempRegister(instr->key()) 2142 ? UseTempRegister(instr->key())
2153 : UseRegisterOrConstantAtStart(instr->key()); 2143 : UseRegisterOrConstantAtStart(instr->key());
2154 LLoadKeyed* result = NULL; 2144 LLoadKeyed* result = NULL;
2155 2145
2156 if (!instr->is_external()) { 2146 if (!instr->is_typed_elements()) {
2157 LOperand* obj = UseRegisterAtStart(instr->elements()); 2147 LOperand* obj = UseRegisterAtStart(instr->elements());
2158 result = new(zone()) LLoadKeyed(obj, key); 2148 result = new(zone()) LLoadKeyed(obj, key);
2159 } else { 2149 } else {
2160 ASSERT( 2150 ASSERT(
2161 (instr->representation().IsInteger32() && 2151 (instr->representation().IsInteger32() &&
2162 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 2152 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) ||
2163 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
2164 (instr->representation().IsDouble() && 2153 (instr->representation().IsDouble() &&
2165 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 2154 (IsDoubleOrFloatElementsKind(instr->elements_kind()))));
2166 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 2155 LOperand* backing_store = UseRegister(instr->elements());
2167 LOperand* external_pointer = UseRegister(instr->elements()); 2156 result = new(zone()) LLoadKeyed(backing_store, key);
2168 result = new(zone()) LLoadKeyed(external_pointer, key);
2169 } 2157 }
2170 2158
2171 DefineAsRegister(result); 2159 DefineAsRegister(result);
2172 bool can_deoptimize = instr->RequiresHoleCheck() || 2160 bool can_deoptimize = instr->RequiresHoleCheck() ||
2173 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); 2161 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS);
2174 // An unsigned int array load might overflow and cause a deopt, make sure it 2162 // An unsigned int array load might overflow and cause a deopt, make sure it
2175 // has an environment. 2163 // has an environment.
2176 return can_deoptimize ? AssignEnvironment(result) : result; 2164 return can_deoptimize ? AssignEnvironment(result) : result;
2177 } 2165 }
2178 2166
2179 2167
2180 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { 2168 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
2181 LOperand* context = UseFixed(instr->context(), esi); 2169 LOperand* context = UseFixed(instr->context(), esi);
2182 LOperand* object = UseFixed(instr->object(), edx); 2170 LOperand* object = UseFixed(instr->object(), edx);
2183 LOperand* key = UseFixed(instr->key(), ecx); 2171 LOperand* key = UseFixed(instr->key(), ecx);
2184 2172
2185 LLoadKeyedGeneric* result = 2173 LLoadKeyedGeneric* result =
2186 new(zone()) LLoadKeyedGeneric(context, object, key); 2174 new(zone()) LLoadKeyedGeneric(context, object, key);
2187 return MarkAsCall(DefineFixed(result, eax), instr); 2175 return MarkAsCall(DefineFixed(result, eax), instr);
2188 } 2176 }
2189 2177
2190 2178
2191 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) { 2179 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) {
2192 ElementsKind elements_kind = instr->elements_kind(); 2180 ElementsKind elements_kind = instr->elements_kind();
2193 2181
2194 // Determine if we need a byte register in this case for the value. 2182 // Determine if we need a byte register in this case for the value.
2195 bool val_is_fixed_register = 2183 bool val_is_fixed_register =
2196 elements_kind == EXTERNAL_BYTE_ELEMENTS || 2184 elements_kind == EXTERNAL_BYTE_ELEMENTS ||
2197 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || 2185 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS ||
2198 elements_kind == EXTERNAL_PIXEL_ELEMENTS; 2186 elements_kind == EXTERNAL_PIXEL_ELEMENTS ||
2187 elements_kind == UINT8_ELEMENTS ||
2188 elements_kind == INT8_ELEMENTS ||
2189 elements_kind == UINT8_CLAMPED_ELEMENTS;
2199 if (val_is_fixed_register) { 2190 if (val_is_fixed_register) {
2200 return UseFixed(instr->value(), eax); 2191 return UseFixed(instr->value(), eax);
2201 } 2192 }
2202 2193
2203 if (!CpuFeatures::IsSafeForSnapshot(SSE2) && 2194 if (!CpuFeatures::IsSafeForSnapshot(SSE2) &&
2204 IsDoubleOrFloatElementsKind(elements_kind)) { 2195 IsDoubleOrFloatElementsKind(elements_kind)) {
2205 return UseRegisterAtStart(instr->value()); 2196 return UseRegisterAtStart(instr->value());
2206 } 2197 }
2207 2198
2208 return UseRegister(instr->value()); 2199 return UseRegister(instr->value());
2209 } 2200 }
2210 2201
2211 2202
2212 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2203 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2213 if (!instr->is_external()) { 2204 if (!instr->is_typed_elements()) {
2214 ASSERT(instr->elements()->representation().IsTagged()); 2205 ASSERT(instr->elements()->representation().IsTagged());
2215 ASSERT(instr->key()->representation().IsInteger32() || 2206 ASSERT(instr->key()->representation().IsInteger32() ||
2216 instr->key()->representation().IsSmi()); 2207 instr->key()->representation().IsSmi());
2217 2208
2218 if (instr->value()->representation().IsDouble()) { 2209 if (instr->value()->representation().IsDouble()) {
2219 LOperand* object = UseRegisterAtStart(instr->elements()); 2210 LOperand* object = UseRegisterAtStart(instr->elements());
2220 LOperand* val = NULL; 2211 LOperand* val = NULL;
2221 val = UseRegisterAtStart(instr->value()); 2212 val = UseRegisterAtStart(instr->value());
2222 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2213 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2223 return new(zone()) LStoreKeyed(object, key, val); 2214 return new(zone()) LStoreKeyed(object, key, val);
(...skipping 11 matching lines...) Expand all
2235 val = UseRegisterOrConstantAtStart(instr->value()); 2226 val = UseRegisterOrConstantAtStart(instr->value());
2236 key = UseRegisterOrConstantAtStart(instr->key()); 2227 key = UseRegisterOrConstantAtStart(instr->key());
2237 } 2228 }
2238 return new(zone()) LStoreKeyed(obj, key, val); 2229 return new(zone()) LStoreKeyed(obj, key, val);
2239 } 2230 }
2240 } 2231 }
2241 2232
2242 ElementsKind elements_kind = instr->elements_kind(); 2233 ElementsKind elements_kind = instr->elements_kind();
2243 ASSERT( 2234 ASSERT(
2244 (instr->value()->representation().IsInteger32() && 2235 (instr->value()->representation().IsInteger32() &&
2245 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && 2236 !IsDoubleOrFloatElementsKind(elements_kind)) ||
2246 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) ||
2247 (instr->value()->representation().IsDouble() && 2237 (instr->value()->representation().IsDouble() &&
2248 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || 2238 IsDoubleOrFloatElementsKind(elements_kind)));
2249 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); 2239 ASSERT((instr->is_fixed_typed_array() &&
2250 ASSERT(instr->elements()->representation().IsExternal()); 2240 instr->elements()->representation().IsTagged()) ||
2241 (instr->is_external() &&
2242 instr->elements()->representation().IsExternal()));
2251 2243
2252 LOperand* external_pointer = UseRegister(instr->elements()); 2244 LOperand* backing_store = UseRegister(instr->elements());
2253 LOperand* val = GetStoreKeyedValueOperand(instr); 2245 LOperand* val = GetStoreKeyedValueOperand(instr);
2254 bool clobbers_key = ExternalArrayOpRequiresTemp( 2246 bool clobbers_key = ExternalArrayOpRequiresTemp(
2255 instr->key()->representation(), elements_kind); 2247 instr->key()->representation(), elements_kind);
2256 LOperand* key = clobbers_key 2248 LOperand* key = clobbers_key
2257 ? UseTempRegister(instr->key()) 2249 ? UseTempRegister(instr->key())
2258 : UseRegisterOrConstantAtStart(instr->key()); 2250 : UseRegisterOrConstantAtStart(instr->key());
2259 return new(zone()) LStoreKeyed(external_pointer, 2251 return new(zone()) LStoreKeyed(backing_store, key, val);
2260 key,
2261 val);
2262 } 2252 }
2263 2253
2264 2254
2265 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { 2255 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
2266 LOperand* context = UseFixed(instr->context(), esi); 2256 LOperand* context = UseFixed(instr->context(), esi);
2267 LOperand* object = UseFixed(instr->object(), edx); 2257 LOperand* object = UseFixed(instr->object(), edx);
2268 LOperand* key = UseFixed(instr->key(), ecx); 2258 LOperand* key = UseFixed(instr->key(), ecx);
2269 LOperand* value = UseFixed(instr->value(), eax); 2259 LOperand* value = UseFixed(instr->value(), eax);
2270 2260
2271 ASSERT(instr->object()->representation().IsTagged()); 2261 ASSERT(instr->object()->representation().IsTagged());
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 LOperand* value = UseFixed(instr->value(), eax); 2371 LOperand* value = UseFixed(instr->value(), eax);
2382 2372
2383 LStoreNamedGeneric* result = 2373 LStoreNamedGeneric* result =
2384 new(zone()) LStoreNamedGeneric(context, object, value); 2374 new(zone()) LStoreNamedGeneric(context, object, value);
2385 return MarkAsCall(result, instr); 2375 return MarkAsCall(result, instr);
2386 } 2376 }
2387 2377
2388 2378
2389 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { 2379 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
2390 LOperand* context = UseFixed(instr->context(), esi); 2380 LOperand* context = UseFixed(instr->context(), esi);
2391 LOperand* left = FLAG_new_string_add 2381 LOperand* left = UseFixed(instr->left(), edx);
2392 ? UseFixed(instr->left(), edx) 2382 LOperand* right = UseFixed(instr->right(), eax);
2393 : UseOrConstantAtStart(instr->left());
2394 LOperand* right = FLAG_new_string_add
2395 ? UseFixed(instr->right(), eax)
2396 : UseOrConstantAtStart(instr->right());
2397 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); 2383 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right);
2398 return MarkAsCall(DefineFixed(string_add, eax), instr); 2384 return MarkAsCall(DefineFixed(string_add, eax), instr);
2399 } 2385 }
2400 2386
2401 2387
2402 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { 2388 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
2403 LOperand* string = UseTempRegister(instr->string()); 2389 LOperand* string = UseTempRegister(instr->string());
2404 LOperand* index = UseTempRegister(instr->index()); 2390 LOperand* index = UseTempRegister(instr->index());
2405 LOperand* context = UseAny(instr->context()); 2391 LOperand* context = UseAny(instr->context());
2406 LStringCharCodeAt* result = 2392 LStringCharCodeAt* result =
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2643 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2658 LOperand* object = UseRegister(instr->object()); 2644 LOperand* object = UseRegister(instr->object());
2659 LOperand* index = UseTempRegister(instr->index()); 2645 LOperand* index = UseTempRegister(instr->index());
2660 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2646 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2661 } 2647 }
2662 2648
2663 2649
2664 } } // namespace v8::internal 2650 } } // namespace v8::internal
2665 2651
2666 #endif // V8_TARGET_ARCH_IA32 2652 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698