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

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

Issue 1254623002: Remove ExternalArray, derived types, and element kinds (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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
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_typed_elements()) { 2244 if (!instr->is_fixed_typed_array()) {
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_external() || instr->is_fixed_typed_array()) { 2258 if (instr->is_fixed_typed_array()) {
2259 // see LCodeGen::DoLoadKeyedExternalArray 2259 // see LCodeGen::DoLoadKeyedExternalArray
2260 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || 2260 needs_environment = elements_kind == UINT32_ELEMENTS &&
2261 elements_kind == UINT32_ELEMENTS) &&
2262 !instr->CheckFlag(HInstruction::kUint32); 2261 !instr->CheckFlag(HInstruction::kUint32);
2263 } else { 2262 } else {
2264 // see LCodeGen::DoLoadKeyedFixedDoubleArray and 2263 // see LCodeGen::DoLoadKeyedFixedDoubleArray and
2265 // LCodeGen::DoLoadKeyedFixedArray 2264 // LCodeGen::DoLoadKeyedFixedArray
2266 needs_environment = 2265 needs_environment =
2267 instr->RequiresHoleCheck() || 2266 instr->RequiresHoleCheck() ||
2268 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); 2267 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub());
2269 } 2268 }
2270 2269
2271 if (needs_environment) { 2270 if (needs_environment) {
(...skipping 19 matching lines...) Expand all
2291 } 2290 }
2292 2291
2293 2292
2294 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2293 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2295 ElementsKind elements_kind = instr->elements_kind(); 2294 ElementsKind elements_kind = instr->elements_kind();
2296 2295
2297 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { 2296 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) {
2298 FindDehoistedKeyDefinitions(instr->key()); 2297 FindDehoistedKeyDefinitions(instr->key());
2299 } 2298 }
2300 2299
2301 if (!instr->is_typed_elements()) { 2300 if (!instr->is_fixed_typed_array()) {
2302 DCHECK(instr->elements()->representation().IsTagged()); 2301 DCHECK(instr->elements()->representation().IsTagged());
2303 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2302 bool needs_write_barrier = instr->NeedsWriteBarrier();
2304 LOperand* object = NULL; 2303 LOperand* object = NULL;
2305 LOperand* key = NULL; 2304 LOperand* key = NULL;
2306 LOperand* val = NULL; 2305 LOperand* val = NULL;
2307 2306
2308 Representation value_representation = instr->value()->representation(); 2307 Representation value_representation = instr->value()->representation();
2309 if (value_representation.IsDouble()) { 2308 if (value_representation.IsDouble()) {
2310 object = UseRegisterAtStart(instr->elements()); 2309 object = UseRegisterAtStart(instr->elements());
2311 val = UseRegisterAtStart(instr->value()); 2310 val = UseRegisterAtStart(instr->value());
(...skipping 14 matching lines...) Expand all
2326 2325
2327 return new(zone()) LStoreKeyed(object, key, val); 2326 return new(zone()) LStoreKeyed(object, key, val);
2328 } 2327 }
2329 2328
2330 DCHECK( 2329 DCHECK(
2331 (instr->value()->representation().IsInteger32() && 2330 (instr->value()->representation().IsInteger32() &&
2332 !IsDoubleOrFloatElementsKind(elements_kind)) || 2331 !IsDoubleOrFloatElementsKind(elements_kind)) ||
2333 (instr->value()->representation().IsDouble() && 2332 (instr->value()->representation().IsDouble() &&
2334 IsDoubleOrFloatElementsKind(elements_kind))); 2333 IsDoubleOrFloatElementsKind(elements_kind)));
2335 DCHECK(instr->elements()->representation().IsExternal()); 2334 DCHECK(instr->elements()->representation().IsExternal());
2336 bool val_is_temp_register = 2335 bool val_is_temp_register = elements_kind == UINT8_CLAMPED_ELEMENTS ||
2337 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || 2336 elements_kind == FLOAT32_ELEMENTS;
2338 elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
2339 elements_kind == FLOAT32_ELEMENTS;
2340 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) 2337 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value())
2341 : UseRegister(instr->value()); 2338 : UseRegister(instr->value());
2342 LOperand* key = NULL; 2339 LOperand* key = NULL;
2343 if (kPointerSize == kInt64Size) { 2340 if (kPointerSize == kInt64Size) {
2344 key = UseRegisterOrConstantAtStart(instr->key()); 2341 key = UseRegisterOrConstantAtStart(instr->key());
2345 } else { 2342 } else {
2346 bool clobbers_key = ExternalArrayOpRequiresTemp( 2343 bool clobbers_key = ExternalArrayOpRequiresTemp(
2347 instr->key()->representation(), elements_kind); 2344 instr->key()->representation(), elements_kind);
2348 key = clobbers_key 2345 key = clobbers_key
2349 ? UseTempRegister(instr->key()) 2346 ? UseTempRegister(instr->key())
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 LAllocateBlockContext* result = 2766 LAllocateBlockContext* result =
2770 new(zone()) LAllocateBlockContext(context, function); 2767 new(zone()) LAllocateBlockContext(context, function);
2771 return MarkAsCall(DefineFixed(result, rsi), instr); 2768 return MarkAsCall(DefineFixed(result, rsi), instr);
2772 } 2769 }
2773 2770
2774 2771
2775 } // namespace internal 2772 } // namespace internal
2776 } // namespace v8 2773 } // namespace v8
2777 2774
2778 #endif // V8_TARGET_ARCH_X64 2775 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698