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

Side by Side Diff: src/arm64/lithium-codegen-arm64.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/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 3440 matching lines...) Expand 10 before | Expand all | Expand 10 after
3451 scratch = ToRegister(instr->temp()); 3451 scratch = ToRegister(instr->temp());
3452 key = ToRegister(instr->key()); 3452 key = ToRegister(instr->key());
3453 } 3453 }
3454 3454
3455 MemOperand mem_op = 3455 MemOperand mem_op =
3456 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi, 3456 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi,
3457 key_is_constant, constant_key, 3457 key_is_constant, constant_key,
3458 elements_kind, 3458 elements_kind,
3459 instr->base_offset()); 3459 instr->base_offset());
3460 3460
3461 if (elements_kind == FLOAT32_ELEMENTS) { 3461 if ((elements_kind == EXTERNAL_FLOAT32_ELEMENTS) ||
3462 (elements_kind == FLOAT32_ELEMENTS)) {
3462 DoubleRegister result = ToDoubleRegister(instr->result()); 3463 DoubleRegister result = ToDoubleRegister(instr->result());
3463 __ Ldr(result.S(), mem_op); 3464 __ Ldr(result.S(), mem_op);
3464 __ Fcvt(result, result.S()); 3465 __ Fcvt(result, result.S());
3465 } else if (elements_kind == FLOAT64_ELEMENTS) { 3466 } else if ((elements_kind == EXTERNAL_FLOAT64_ELEMENTS) ||
3467 (elements_kind == FLOAT64_ELEMENTS)) {
3466 DoubleRegister result = ToDoubleRegister(instr->result()); 3468 DoubleRegister result = ToDoubleRegister(instr->result());
3467 __ Ldr(result, mem_op); 3469 __ Ldr(result, mem_op);
3468 } else { 3470 } else {
3469 Register result = ToRegister(instr->result()); 3471 Register result = ToRegister(instr->result());
3470 3472
3471 switch (elements_kind) { 3473 switch (elements_kind) {
3474 case EXTERNAL_INT8_ELEMENTS:
3472 case INT8_ELEMENTS: 3475 case INT8_ELEMENTS:
3473 __ Ldrsb(result, mem_op); 3476 __ Ldrsb(result, mem_op);
3474 break; 3477 break;
3478 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
3479 case EXTERNAL_UINT8_ELEMENTS:
3475 case UINT8_ELEMENTS: 3480 case UINT8_ELEMENTS:
3476 case UINT8_CLAMPED_ELEMENTS: 3481 case UINT8_CLAMPED_ELEMENTS:
3477 __ Ldrb(result, mem_op); 3482 __ Ldrb(result, mem_op);
3478 break; 3483 break;
3484 case EXTERNAL_INT16_ELEMENTS:
3479 case INT16_ELEMENTS: 3485 case INT16_ELEMENTS:
3480 __ Ldrsh(result, mem_op); 3486 __ Ldrsh(result, mem_op);
3481 break; 3487 break;
3488 case EXTERNAL_UINT16_ELEMENTS:
3482 case UINT16_ELEMENTS: 3489 case UINT16_ELEMENTS:
3483 __ Ldrh(result, mem_op); 3490 __ Ldrh(result, mem_op);
3484 break; 3491 break;
3492 case EXTERNAL_INT32_ELEMENTS:
3485 case INT32_ELEMENTS: 3493 case INT32_ELEMENTS:
3486 __ Ldrsw(result, mem_op); 3494 __ Ldrsw(result, mem_op);
3487 break; 3495 break;
3496 case EXTERNAL_UINT32_ELEMENTS:
3488 case UINT32_ELEMENTS: 3497 case UINT32_ELEMENTS:
3489 __ Ldr(result.W(), mem_op); 3498 __ Ldr(result.W(), mem_op);
3490 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { 3499 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
3491 // Deopt if value > 0x80000000. 3500 // Deopt if value > 0x80000000.
3492 __ Tst(result, 0xFFFFFFFF80000000); 3501 __ Tst(result, 0xFFFFFFFF80000000);
3493 DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue); 3502 DeoptimizeIf(ne, instr, Deoptimizer::kNegativeValue);
3494 } 3503 }
3495 break; 3504 break;
3496 case FLOAT32_ELEMENTS: 3505 case FLOAT32_ELEMENTS:
3497 case FLOAT64_ELEMENTS: 3506 case FLOAT64_ELEMENTS:
3507 case EXTERNAL_FLOAT32_ELEMENTS:
3508 case EXTERNAL_FLOAT64_ELEMENTS:
3498 case FAST_HOLEY_DOUBLE_ELEMENTS: 3509 case FAST_HOLEY_DOUBLE_ELEMENTS:
3499 case FAST_HOLEY_ELEMENTS: 3510 case FAST_HOLEY_ELEMENTS:
3500 case FAST_HOLEY_SMI_ELEMENTS: 3511 case FAST_HOLEY_SMI_ELEMENTS:
3501 case FAST_DOUBLE_ELEMENTS: 3512 case FAST_DOUBLE_ELEMENTS:
3502 case FAST_ELEMENTS: 3513 case FAST_ELEMENTS:
3503 case FAST_SMI_ELEMENTS: 3514 case FAST_SMI_ELEMENTS:
3504 case DICTIONARY_ELEMENTS: 3515 case DICTIONARY_ELEMENTS:
3505 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: 3516 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
3506 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: 3517 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
3507 UNREACHABLE(); 3518 UNREACHABLE();
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
5162 key = ToRegister(instr->key()); 5173 key = ToRegister(instr->key());
5163 scratch = ToRegister(instr->temp()); 5174 scratch = ToRegister(instr->temp());
5164 } 5175 }
5165 5176
5166 MemOperand dst = 5177 MemOperand dst =
5167 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi, 5178 PrepareKeyedExternalArrayOperand(key, ext_ptr, scratch, key_is_smi,
5168 key_is_constant, constant_key, 5179 key_is_constant, constant_key,
5169 elements_kind, 5180 elements_kind,
5170 instr->base_offset()); 5181 instr->base_offset());
5171 5182
5172 if (elements_kind == FLOAT32_ELEMENTS) { 5183 if ((elements_kind == EXTERNAL_FLOAT32_ELEMENTS) ||
5184 (elements_kind == FLOAT32_ELEMENTS)) {
5173 DoubleRegister value = ToDoubleRegister(instr->value()); 5185 DoubleRegister value = ToDoubleRegister(instr->value());
5174 DoubleRegister dbl_scratch = double_scratch(); 5186 DoubleRegister dbl_scratch = double_scratch();
5175 __ Fcvt(dbl_scratch.S(), value); 5187 __ Fcvt(dbl_scratch.S(), value);
5176 __ Str(dbl_scratch.S(), dst); 5188 __ Str(dbl_scratch.S(), dst);
5177 } else if (elements_kind == FLOAT64_ELEMENTS) { 5189 } else if ((elements_kind == EXTERNAL_FLOAT64_ELEMENTS) ||
5190 (elements_kind == FLOAT64_ELEMENTS)) {
5178 DoubleRegister value = ToDoubleRegister(instr->value()); 5191 DoubleRegister value = ToDoubleRegister(instr->value());
5179 __ Str(value, dst); 5192 __ Str(value, dst);
5180 } else { 5193 } else {
5181 Register value = ToRegister(instr->value()); 5194 Register value = ToRegister(instr->value());
5182 5195
5183 switch (elements_kind) { 5196 switch (elements_kind) {
5197 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
5198 case EXTERNAL_INT8_ELEMENTS:
5199 case EXTERNAL_UINT8_ELEMENTS:
5184 case UINT8_ELEMENTS: 5200 case UINT8_ELEMENTS:
5185 case UINT8_CLAMPED_ELEMENTS: 5201 case UINT8_CLAMPED_ELEMENTS:
5186 case INT8_ELEMENTS: 5202 case INT8_ELEMENTS:
5187 __ Strb(value, dst); 5203 __ Strb(value, dst);
5188 break; 5204 break;
5205 case EXTERNAL_INT16_ELEMENTS:
5206 case EXTERNAL_UINT16_ELEMENTS:
5189 case INT16_ELEMENTS: 5207 case INT16_ELEMENTS:
5190 case UINT16_ELEMENTS: 5208 case UINT16_ELEMENTS:
5191 __ Strh(value, dst); 5209 __ Strh(value, dst);
5192 break; 5210 break;
5211 case EXTERNAL_INT32_ELEMENTS:
5212 case EXTERNAL_UINT32_ELEMENTS:
5193 case INT32_ELEMENTS: 5213 case INT32_ELEMENTS:
5194 case UINT32_ELEMENTS: 5214 case UINT32_ELEMENTS:
5195 __ Str(value.W(), dst); 5215 __ Str(value.W(), dst);
5196 break; 5216 break;
5197 case FLOAT32_ELEMENTS: 5217 case FLOAT32_ELEMENTS:
5198 case FLOAT64_ELEMENTS: 5218 case FLOAT64_ELEMENTS:
5219 case EXTERNAL_FLOAT32_ELEMENTS:
5220 case EXTERNAL_FLOAT64_ELEMENTS:
5199 case FAST_DOUBLE_ELEMENTS: 5221 case FAST_DOUBLE_ELEMENTS:
5200 case FAST_ELEMENTS: 5222 case FAST_ELEMENTS:
5201 case FAST_SMI_ELEMENTS: 5223 case FAST_SMI_ELEMENTS:
5202 case FAST_HOLEY_DOUBLE_ELEMENTS: 5224 case FAST_HOLEY_DOUBLE_ELEMENTS:
5203 case FAST_HOLEY_ELEMENTS: 5225 case FAST_HOLEY_ELEMENTS:
5204 case FAST_HOLEY_SMI_ELEMENTS: 5226 case FAST_HOLEY_SMI_ELEMENTS:
5205 case DICTIONARY_ELEMENTS: 5227 case DICTIONARY_ELEMENTS:
5206 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: 5228 case FAST_SLOPPY_ARGUMENTS_ELEMENTS:
5207 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: 5229 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS:
5208 UNREACHABLE(); 5230 UNREACHABLE();
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
6162 Handle<ScopeInfo> scope_info = instr->scope_info(); 6184 Handle<ScopeInfo> scope_info = instr->scope_info();
6163 __ Push(scope_info); 6185 __ Push(scope_info);
6164 __ Push(ToRegister(instr->function())); 6186 __ Push(ToRegister(instr->function()));
6165 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6187 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6166 RecordSafepoint(Safepoint::kNoLazyDeopt); 6188 RecordSafepoint(Safepoint::kNoLazyDeopt);
6167 } 6189 }
6168 6190
6169 6191
6170 } // namespace internal 6192 } // namespace internal
6171 } // namespace v8 6193 } // 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