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/x64/lithium-x64.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/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.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_X64 9 #if V8_TARGET_ARCH_X64
10 10
(...skipping 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 instr->key()->representation(), elements_kind); 2234 instr->key()->representation(), elements_kind);
2235 key = clobbers_key 2235 key = clobbers_key
2236 ? UseTempRegister(instr->key()) 2236 ? UseTempRegister(instr->key())
2237 : UseRegisterOrConstantAtStart(instr->key()); 2237 : UseRegisterOrConstantAtStart(instr->key());
2238 } 2238 }
2239 2239
2240 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { 2240 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) {
2241 FindDehoistedKeyDefinitions(instr->key()); 2241 FindDehoistedKeyDefinitions(instr->key());
2242 } 2242 }
2243 2243
2244 if (!instr->is_fixed_typed_array()) { 2244 if (!instr->is_typed_elements()) {
2245 LOperand* obj = UseRegisterAtStart(instr->elements()); 2245 LOperand* obj = UseRegisterAtStart(instr->elements());
2246 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); 2246 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key));
2247 } else { 2247 } else {
2248 DCHECK( 2248 DCHECK(
2249 (instr->representation().IsInteger32() && 2249 (instr->representation().IsInteger32() &&
2250 !(IsDoubleOrFloatElementsKind(elements_kind))) || 2250 !(IsDoubleOrFloatElementsKind(elements_kind))) ||
2251 (instr->representation().IsDouble() && 2251 (instr->representation().IsDouble() &&
2252 (IsDoubleOrFloatElementsKind(elements_kind)))); 2252 (IsDoubleOrFloatElementsKind(elements_kind))));
2253 LOperand* backing_store = UseRegister(instr->elements()); 2253 LOperand* backing_store = UseRegister(instr->elements());
2254 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); 2254 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key));
2255 } 2255 }
2256 2256
2257 bool needs_environment; 2257 bool needs_environment;
2258 if (instr->is_fixed_typed_array()) { 2258 if (instr->is_external() || instr->is_fixed_typed_array()) {
2259 // see LCodeGen::DoLoadKeyedExternalArray 2259 // see LCodeGen::DoLoadKeyedExternalArray
2260 needs_environment = elements_kind == UINT32_ELEMENTS && 2260 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS ||
2261 elements_kind == UINT32_ELEMENTS) &&
2261 !instr->CheckFlag(HInstruction::kUint32); 2262 !instr->CheckFlag(HInstruction::kUint32);
2262 } else { 2263 } else {
2263 // see LCodeGen::DoLoadKeyedFixedDoubleArray and 2264 // see LCodeGen::DoLoadKeyedFixedDoubleArray and
2264 // LCodeGen::DoLoadKeyedFixedArray 2265 // LCodeGen::DoLoadKeyedFixedArray
2265 needs_environment = 2266 needs_environment =
2266 instr->RequiresHoleCheck() || 2267 instr->RequiresHoleCheck() ||
2267 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); 2268 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub());
2268 } 2269 }
2269 2270
2270 if (needs_environment) { 2271 if (needs_environment) {
(...skipping 19 matching lines...) Expand all
2290 } 2291 }
2291 2292
2292 2293
2293 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2294 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2294 ElementsKind elements_kind = instr->elements_kind(); 2295 ElementsKind elements_kind = instr->elements_kind();
2295 2296
2296 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { 2297 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) {
2297 FindDehoistedKeyDefinitions(instr->key()); 2298 FindDehoistedKeyDefinitions(instr->key());
2298 } 2299 }
2299 2300
2300 if (!instr->is_fixed_typed_array()) { 2301 if (!instr->is_typed_elements()) {
2301 DCHECK(instr->elements()->representation().IsTagged()); 2302 DCHECK(instr->elements()->representation().IsTagged());
2302 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2303 bool needs_write_barrier = instr->NeedsWriteBarrier();
2303 LOperand* object = NULL; 2304 LOperand* object = NULL;
2304 LOperand* key = NULL; 2305 LOperand* key = NULL;
2305 LOperand* val = NULL; 2306 LOperand* val = NULL;
2306 2307
2307 Representation value_representation = instr->value()->representation(); 2308 Representation value_representation = instr->value()->representation();
2308 if (value_representation.IsDouble()) { 2309 if (value_representation.IsDouble()) {
2309 object = UseRegisterAtStart(instr->elements()); 2310 object = UseRegisterAtStart(instr->elements());
2310 val = UseRegisterAtStart(instr->value()); 2311 val = UseRegisterAtStart(instr->value());
(...skipping 14 matching lines...) Expand all
2325 2326
2326 return new(zone()) LStoreKeyed(object, key, val); 2327 return new(zone()) LStoreKeyed(object, key, val);
2327 } 2328 }
2328 2329
2329 DCHECK( 2330 DCHECK(
2330 (instr->value()->representation().IsInteger32() && 2331 (instr->value()->representation().IsInteger32() &&
2331 !IsDoubleOrFloatElementsKind(elements_kind)) || 2332 !IsDoubleOrFloatElementsKind(elements_kind)) ||
2332 (instr->value()->representation().IsDouble() && 2333 (instr->value()->representation().IsDouble() &&
2333 IsDoubleOrFloatElementsKind(elements_kind))); 2334 IsDoubleOrFloatElementsKind(elements_kind)));
2334 DCHECK(instr->elements()->representation().IsExternal()); 2335 DCHECK(instr->elements()->representation().IsExternal());
2335 bool val_is_temp_register = elements_kind == UINT8_CLAMPED_ELEMENTS || 2336 bool val_is_temp_register =
2336 elements_kind == FLOAT32_ELEMENTS; 2337 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS ||
2338 elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
2339 elements_kind == FLOAT32_ELEMENTS;
2337 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) 2340 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value())
2338 : UseRegister(instr->value()); 2341 : UseRegister(instr->value());
2339 LOperand* key = NULL; 2342 LOperand* key = NULL;
2340 if (kPointerSize == kInt64Size) { 2343 if (kPointerSize == kInt64Size) {
2341 key = UseRegisterOrConstantAtStart(instr->key()); 2344 key = UseRegisterOrConstantAtStart(instr->key());
2342 } else { 2345 } else {
2343 bool clobbers_key = ExternalArrayOpRequiresTemp( 2346 bool clobbers_key = ExternalArrayOpRequiresTemp(
2344 instr->key()->representation(), elements_kind); 2347 instr->key()->representation(), elements_kind);
2345 key = clobbers_key 2348 key = clobbers_key
2346 ? UseTempRegister(instr->key()) 2349 ? UseTempRegister(instr->key())
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2766 LAllocateBlockContext* result = 2769 LAllocateBlockContext* result =
2767 new(zone()) LAllocateBlockContext(context, function); 2770 new(zone()) LAllocateBlockContext(context, function);
2768 return MarkAsCall(DefineFixed(result, rsi), instr); 2771 return MarkAsCall(DefineFixed(result, rsi), instr);
2769 } 2772 }
2770 2773
2771 2774
2772 } // namespace internal 2775 } // namespace internal
2773 } // namespace v8 2776 } // namespace v8
2774 2777
2775 #endif // V8_TARGET_ARCH_X64 2778 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698