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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1262583002: Reland of "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
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/bootstrapper.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3437 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 scratch = ToRegister(instr->temp()); 3448 scratch = ToRegister(instr->temp());
3449 key = ToRegister(instr->key()); 3449 key = ToRegister(instr->key());
3450 } 3450 }
3451 3451
3452 MemOperand mem_op = 3452 MemOperand mem_op =
3453 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi, 3453 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi,
3454 key_is_constant, constant_key, 3454 key_is_constant, constant_key,
3455 elements_kind, 3455 elements_kind,
3456 instr->base_offset()); 3456 instr->base_offset());
3457 3457
3458 if ((elements_kind == EXTERNAL_FLOAT32_ELEMENTS) || 3458 if (elements_kind == FLOAT32_ELEMENTS) {
3459 (elements_kind == FLOAT32_ELEMENTS)) {
3460 DoubleRegister result = ToDoubleRegister(instr->result()); 3459 DoubleRegister result = ToDoubleRegister(instr->result());
3461 __ Ldr(result.S(), mem_op); 3460 __ Ldr(result.S(), mem_op);
3462 __ Fcvt(result, result.S()); 3461 __ Fcvt(result, result.S());
3463 } else if ((elements_kind == EXTERNAL_FLOAT64_ELEMENTS) || 3462 } else if (elements_kind == FLOAT64_ELEMENTS) {
3464 (elements_kind == FLOAT64_ELEMENTS)) {
3465 DoubleRegister result = ToDoubleRegister(instr->result()); 3463 DoubleRegister result = ToDoubleRegister(instr->result());
3466 __ Ldr(result, mem_op); 3464 __ Ldr(result, mem_op);
3467 } else { 3465 } else {
3468 Register result = ToRegister(instr->result()); 3466 Register result = ToRegister(instr->result());
3469 3467
3470 switch (elements_kind) { 3468 switch (elements_kind) {
3471 case EXTERNAL_INT8_ELEMENTS:
3472 case INT8_ELEMENTS: 3469 case INT8_ELEMENTS:
3473 __ Ldrsb(result, mem_op); 3470 __ Ldrsb(result, mem_op);
3474 break; 3471 break;
3475 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
3476 case EXTERNAL_UINT8_ELEMENTS:
3477 case UINT8_ELEMENTS: 3472 case UINT8_ELEMENTS:
3478 case UINT8_CLAMPED_ELEMENTS: 3473 case UINT8_CLAMPED_ELEMENTS:
3479 __ Ldrb(result, mem_op); 3474 __ Ldrb(result, mem_op);
3480 break; 3475 break;
3481 case EXTERNAL_INT16_ELEMENTS:
3482 case INT16_ELEMENTS: 3476 case INT16_ELEMENTS:
3483 __ Ldrsh(result, mem_op); 3477 __ Ldrsh(result, mem_op);
3484 break; 3478 break;
3485 case EXTERNAL_UINT16_ELEMENTS:
3486 case UINT16_ELEMENTS: 3479 case UINT16_ELEMENTS:
3487 __ Ldrh(result, mem_op); 3480 __ Ldrh(result, mem_op);
3488 break; 3481 break;
3489 case EXTERNAL_INT32_ELEMENTS:
3490 case INT32_ELEMENTS: 3482 case INT32_ELEMENTS:
3491 __ Ldrsw(result, mem_op); 3483 __ Ldrsw(result, mem_op);
3492 break; 3484 break;
3493 case EXTERNAL_UINT32_ELEMENTS:
3494 case UINT32_ELEMENTS: 3485 case UINT32_ELEMENTS:
3495 __ Ldr(result.W(), mem_op); 3486 __ Ldr(result.W(), mem_op);
3496 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { 3487 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
3497 // Deopt if value > 0x80000000. 3488 // Deopt if value > 0x80000000.
3498 __ Tst(result, 0xFFFFFFFF80000000); 3489 __ Tst(result, 0xFFFFFFFF80000000);
3499 DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue); 3490 DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue);
3500 } 3491 }
3501 break; 3492 break;
3502 case FLOAT32_ELEMENTS: 3493 case FLOAT32_ELEMENTS:
3503 case FLOAT64_ELEMENTS: 3494 case FLOAT64_ELEMENTS:
3504 case EXTERNAL_FLOAT32_ELEMENTS:
3505 case EXTERNAL_FLOAT64_ELEMENTS:
3506 case FAST_HOLEY_DOUBLE_ELEMENTS: 3495 case FAST_HOLEY_DOUBLE_ELEMENTS:
3507 case FAST_HOLEY_ELEMENTS: 3496 case FAST_HOLEY_ELEMENTS:
3508 case FAST_HOLEY_SMI_ELEMENTS: 3497 case FAST_HOLEY_SMI_ELEMENTS:
3509 case FAST_DOUBLE_ELEMENTS: 3498 case FAST_DOUBLE_ELEMENTS:
3510 case FAST_ELEMENTS: 3499 case FAST_ELEMENTS:
3511 case FAST_SMI_ELEMENTS: 3500 case FAST_SMI_ELEMENTS:
3512 case DICTIONARY_ELEMENTS: 3501 case DICTIONARY_ELEMENTS:
3513 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: 3502 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
3514 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: 3503 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
3515 UNREACHABLE(); 3504 UNREACHABLE();
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
5170 key = ToRegister(instr->key()); 5159 key = ToRegister(instr->key());
5171 scratch = ToRegister(instr->temp()); 5160 scratch = ToRegister(instr->temp());
5172 } 5161 }
5173 5162
5174 MemOperand dst = 5163 MemOperand dst =
5175 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi, 5164 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi,
5176 key_is_constant, constant_key, 5165 key_is_constant, constant_key,
5177 elements_kind, 5166 elements_kind,
5178 instr->base_offset()); 5167 instr->base_offset());
5179 5168
5180 if ((elements_kind == EXTERNAL_FLOAT32_ELEMENTS) || 5169 if (elements_kind == FLOAT32_ELEMENTS) {
5181 (elements_kind == FLOAT32_ELEMENTS)) {
5182 DoubleRegister value = ToDoubleRegister(instr->value()); 5170 DoubleRegister value = ToDoubleRegister(instr->value());
5183 DoubleRegister dbl_scratch = double_scratch(); 5171 DoubleRegister dbl_scratch = double_scratch();
5184 __ Fcvt(dbl_scratch.S(), value); 5172 __ Fcvt(dbl_scratch.S(), value);
5185 __ Str(dbl_scratch.S(), dst); 5173 __ Str(dbl_scratch.S(), dst);
5186 } else if ((elements_kind == EXTERNAL_FLOAT64_ELEMENTS) || 5174 } else if (elements_kind == FLOAT64_ELEMENTS) {
5187 (elements_kind == FLOAT64_ELEMENTS)) {
5188 DoubleRegister value = ToDoubleRegister(instr->value()); 5175 DoubleRegister value = ToDoubleRegister(instr->value());
5189 __ Str(value, dst); 5176 __ Str(value, dst);
5190 } else { 5177 } else {
5191 Register value = ToRegister(instr->value()); 5178 Register value = ToRegister(instr->value());
5192 5179
5193 switch (elements_kind) { 5180 switch (elements_kind) {
5194 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
5195 case EXTERNAL_INT8_ELEMENTS:
5196 case EXTERNAL_UINT8_ELEMENTS:
5197 case UINT8_ELEMENTS: 5181 case UINT8_ELEMENTS:
5198 case UINT8_CLAMPED_ELEMENTS: 5182 case UINT8_CLAMPED_ELEMENTS:
5199 case INT8_ELEMENTS: 5183 case INT8_ELEMENTS:
5200 __ Strb(value, dst); 5184 __ Strb(value, dst);
5201 break; 5185 break;
5202 case EXTERNAL_INT16_ELEMENTS:
5203 case EXTERNAL_UINT16_ELEMENTS:
5204 case INT16_ELEMENTS: 5186 case INT16_ELEMENTS:
5205 case UINT16_ELEMENTS: 5187 case UINT16_ELEMENTS:
5206 __ Strh(value, dst); 5188 __ Strh(value, dst);
5207 break; 5189 break;
5208 case EXTERNAL_INT32_ELEMENTS:
5209 case EXTERNAL_UINT32_ELEMENTS:
5210 case INT32_ELEMENTS: 5190 case INT32_ELEMENTS:
5211 case UINT32_ELEMENTS: 5191 case UINT32_ELEMENTS:
5212 __ Str(value.W(), dst); 5192 __ Str(value.W(), dst);
5213 break; 5193 break;
5214 case FLOAT32_ELEMENTS: 5194 case FLOAT32_ELEMENTS:
5215 case FLOAT64_ELEMENTS: 5195 case FLOAT64_ELEMENTS:
5216 case EXTERNAL_FLOAT32_ELEMENTS:
5217 case EXTERNAL_FLOAT64_ELEMENTS:
5218 case FAST_DOUBLE_ELEMENTS: 5196 case FAST_DOUBLE_ELEMENTS:
5219 case FAST_ELEMENTS: 5197 case FAST_ELEMENTS:
5220 case FAST_SMI_ELEMENTS: 5198 case FAST_SMI_ELEMENTS:
5221 case FAST_HOLEY_DOUBLE_ELEMENTS: 5199 case FAST_HOLEY_DOUBLE_ELEMENTS:
5222 case FAST_HOLEY_ELEMENTS: 5200 case FAST_HOLEY_ELEMENTS:
5223 case FAST_HOLEY_SMI_ELEMENTS: 5201 case FAST_HOLEY_SMI_ELEMENTS:
5224 case DICTIONARY_ELEMENTS: 5202 case DICTIONARY_ELEMENTS:
5225 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: 5203 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
5226 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: 5204 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
5227 UNREACHABLE(); 5205 UNREACHABLE();
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
6178 Handle<ScopeInfo> scope_info = instr->scope_info(); 6156 Handle<ScopeInfo> scope_info = instr->scope_info();
6179 __ Push(scope_info); 6157 __ Push(scope_info);
6180 __ Push(ToRegister(instr->function())); 6158 __ Push(ToRegister(instr->function()));
6181 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6159 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6182 RecordSafepoint(Safepoint::kNoLazyDeopt); 6160 RecordSafepoint(Safepoint::kNoLazyDeopt);
6183 } 6161 }
6184 6162
6185 6163
6186 } // namespace internal 6164 } // namespace internal
6187 } // namespace v8 6165 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698