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

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

Issue 1257223002: Revert of Remove ExternalArray, derived types, and element kinds (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ic/handler-compiler.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 10
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2235 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2236 DCHECK(instr->key()->representation().IsSmiOrInteger32()); 2236 DCHECK(instr->key()->representation().IsSmiOrInteger32());
2237 ElementsKind elements_kind = instr->elements_kind(); 2237 ElementsKind elements_kind = instr->elements_kind();
2238 bool clobbers_key = ExternalArrayOpRequiresTemp( 2238 bool clobbers_key = ExternalArrayOpRequiresTemp(
2239 instr->key()->representation(), elements_kind); 2239 instr->key()->representation(), elements_kind);
2240 LOperand* key = clobbers_key 2240 LOperand* key = clobbers_key
2241 ? UseTempRegister(instr->key()) 2241 ? UseTempRegister(instr->key())
2242 : UseRegisterOrConstantAtStart(instr->key()); 2242 : UseRegisterOrConstantAtStart(instr->key());
2243 LInstruction* result = NULL; 2243 LInstruction* result = NULL;
2244 2244
2245 if (!instr->is_fixed_typed_array()) { 2245 if (!instr->is_typed_elements()) {
2246 LOperand* obj = UseRegisterAtStart(instr->elements()); 2246 LOperand* obj = UseRegisterAtStart(instr->elements());
2247 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); 2247 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key));
2248 } else { 2248 } else {
2249 DCHECK( 2249 DCHECK(
2250 (instr->representation().IsInteger32() && 2250 (instr->representation().IsInteger32() &&
2251 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || 2251 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) ||
2252 (instr->representation().IsDouble() && 2252 (instr->representation().IsDouble() &&
2253 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); 2253 (IsDoubleOrFloatElementsKind(instr->elements_kind()))));
2254 LOperand* backing_store = UseRegister(instr->elements()); 2254 LOperand* backing_store = UseRegister(instr->elements());
2255 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); 2255 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key));
2256 } 2256 }
2257 2257
2258 bool needs_environment; 2258 bool needs_environment;
2259 if (instr->is_fixed_typed_array()) { 2259 if (instr->is_external() || instr->is_fixed_typed_array()) {
2260 // see LCodeGen::DoLoadKeyedExternalArray 2260 // see LCodeGen::DoLoadKeyedExternalArray
2261 needs_environment = elements_kind == UINT32_ELEMENTS && 2261 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS ||
2262 elements_kind == UINT32_ELEMENTS) &&
2262 !instr->CheckFlag(HInstruction::kUint32); 2263 !instr->CheckFlag(HInstruction::kUint32);
2263 } else { 2264 } else {
2264 // see LCodeGen::DoLoadKeyedFixedDoubleArray and 2265 // see LCodeGen::DoLoadKeyedFixedDoubleArray and
2265 // LCodeGen::DoLoadKeyedFixedArray 2266 // LCodeGen::DoLoadKeyedFixedArray
2266 needs_environment = 2267 needs_environment =
2267 instr->RequiresHoleCheck() || 2268 instr->RequiresHoleCheck() ||
2268 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); 2269 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub());
2269 } 2270 }
2270 2271
2271 if (needs_environment) { 2272 if (needs_environment) {
(...skipping 16 matching lines...) Expand all
2288 new(zone()) LLoadKeyedGeneric(context, object, key, vector); 2289 new(zone()) LLoadKeyedGeneric(context, object, key, vector);
2289 return MarkAsCall(DefineFixed(result, eax), instr); 2290 return MarkAsCall(DefineFixed(result, eax), instr);
2290 } 2291 }
2291 2292
2292 2293
2293 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) { 2294 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) {
2294 ElementsKind elements_kind = instr->elements_kind(); 2295 ElementsKind elements_kind = instr->elements_kind();
2295 2296
2296 // Determine if we need a byte register in this case for the value. 2297 // Determine if we need a byte register in this case for the value.
2297 bool val_is_fixed_register = 2298 bool val_is_fixed_register =
2299 elements_kind == EXTERNAL_INT8_ELEMENTS ||
2300 elements_kind == EXTERNAL_UINT8_ELEMENTS ||
2301 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS ||
2298 elements_kind == UINT8_ELEMENTS || 2302 elements_kind == UINT8_ELEMENTS ||
2299 elements_kind == INT8_ELEMENTS || 2303 elements_kind == INT8_ELEMENTS ||
2300 elements_kind == UINT8_CLAMPED_ELEMENTS; 2304 elements_kind == UINT8_CLAMPED_ELEMENTS;
2301 if (val_is_fixed_register) { 2305 if (val_is_fixed_register) {
2302 return UseFixed(instr->value(), eax); 2306 return UseFixed(instr->value(), eax);
2303 } 2307 }
2304 2308
2305 return UseRegister(instr->value()); 2309 return UseRegister(instr->value());
2306 } 2310 }
2307 2311
2308 2312
2309 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2313 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2310 if (!instr->is_fixed_typed_array()) { 2314 if (!instr->is_typed_elements()) {
2311 DCHECK(instr->elements()->representation().IsTagged()); 2315 DCHECK(instr->elements()->representation().IsTagged());
2312 DCHECK(instr->key()->representation().IsInteger32() || 2316 DCHECK(instr->key()->representation().IsInteger32() ||
2313 instr->key()->representation().IsSmi()); 2317 instr->key()->representation().IsSmi());
2314 2318
2315 if (instr->value()->representation().IsDouble()) { 2319 if (instr->value()->representation().IsDouble()) {
2316 LOperand* object = UseRegisterAtStart(instr->elements()); 2320 LOperand* object = UseRegisterAtStart(instr->elements());
2317 LOperand* val = NULL; 2321 LOperand* val = NULL;
2318 val = UseRegisterAtStart(instr->value()); 2322 val = UseRegisterAtStart(instr->value());
2319 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2323 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2320 return new(zone()) LStoreKeyed(object, key, val); 2324 return new(zone()) LStoreKeyed(object, key, val);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 LAllocateBlockContext* result = 2785 LAllocateBlockContext* result =
2782 new(zone()) LAllocateBlockContext(context, function); 2786 new(zone()) LAllocateBlockContext(context, function);
2783 return MarkAsCall(DefineFixed(result, esi), instr); 2787 return MarkAsCall(DefineFixed(result, esi), instr);
2784 } 2788 }
2785 2789
2786 2790
2787 } // namespace internal 2791 } // namespace internal
2788 } // namespace v8 2792 } // namespace v8
2789 2793
2790 #endif // V8_TARGET_ARCH_IA32 2794 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ic/handler-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698