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

Unified Diff: src/ppc/lithium-codegen-ppc.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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-printer.cc ('k') | src/ppc/lithium-ppc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/lithium-codegen-ppc.cc
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc
index 7bc4d00237d88ff96af4937c9bd145f5d09bd4a8..8968f2fc09de4adfd3ab3363e5db9c18295844d7 100644
--- a/src/ppc/lithium-codegen-ppc.cc
+++ b/src/ppc/lithium-codegen-ppc.cc
@@ -3293,7 +3293,10 @@
bool key_is_smi = instr->hydrogen()->key()->representation().IsSmi();
int base_offset = instr->base_offset();
- if (elements_kind == FLOAT32_ELEMENTS || elements_kind == FLOAT64_ELEMENTS) {
+ if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
+ elements_kind == FLOAT32_ELEMENTS ||
+ elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
+ elements_kind == FLOAT64_ELEMENTS) {
DoubleRegister result = ToDoubleRegister(instr->result());
if (key_is_constant) {
__ Add(scratch0(), external_pointer, constant_key << element_size_shift,
@@ -3302,7 +3305,8 @@
__ IndexToArrayOffset(r0, key, element_size_shift, key_is_smi);
__ add(scratch0(), external_pointer, r0);
}
- if (elements_kind == FLOAT32_ELEMENTS) {
+ if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
+ elements_kind == FLOAT32_ELEMENTS) {
__ lfs(result, MemOperand(scratch0(), base_offset));
} else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS
__ lfd(result, MemOperand(scratch0(), base_offset));
@@ -3313,6 +3317,7 @@
PrepareKeyedOperand(key, external_pointer, key_is_constant, key_is_smi,
constant_key, element_size_shift, base_offset);
switch (elements_kind) {
+ case EXTERNAL_INT8_ELEMENTS:
case INT8_ELEMENTS:
if (key_is_constant) {
__ LoadByte(result, mem_operand, r0);
@@ -3321,6 +3326,8 @@
}
__ extsb(result, result);
break;
+ case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
+ case EXTERNAL_UINT8_ELEMENTS:
case UINT8_ELEMENTS:
case UINT8_CLAMPED_ELEMENTS:
if (key_is_constant) {
@@ -3329,6 +3336,7 @@
__ lbzx(result, mem_operand);
}
break;
+ case EXTERNAL_INT16_ELEMENTS:
case INT16_ELEMENTS:
if (key_is_constant) {
__ LoadHalfWordArith(result, mem_operand, r0);
@@ -3336,6 +3344,7 @@
__ lhax(result, mem_operand);
}
break;
+ case EXTERNAL_UINT16_ELEMENTS:
case UINT16_ELEMENTS:
if (key_is_constant) {
__ LoadHalfWord(result, mem_operand, r0);
@@ -3343,6 +3352,7 @@
__ lhzx(result, mem_operand);
}
break;
+ case EXTERNAL_INT32_ELEMENTS:
case INT32_ELEMENTS:
if (key_is_constant) {
__ LoadWordArith(result, mem_operand, r0);
@@ -3350,6 +3360,7 @@
__ lwax(result, mem_operand);
}
break;
+ case EXTERNAL_UINT32_ELEMENTS:
case UINT32_ELEMENTS:
if (key_is_constant) {
__ LoadWord(result, mem_operand, r0);
@@ -3364,6 +3375,8 @@
break;
case FLOAT32_ELEMENTS:
case FLOAT64_ELEMENTS:
+ case EXTERNAL_FLOAT32_ELEMENTS:
+ case EXTERNAL_FLOAT64_ELEMENTS:
case FAST_HOLEY_DOUBLE_ELEMENTS:
case FAST_HOLEY_ELEMENTS:
case FAST_HOLEY_SMI_ELEMENTS:
@@ -3500,7 +3513,7 @@
void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) {
- if (instr->is_fixed_typed_array()) {
+ if (instr->is_typed_elements()) {
DoLoadKeyedExternalArray(instr);
} else if (instr->hydrogen()->representation().IsDouble()) {
DoLoadKeyedFixedDoubleArray(instr);
@@ -4547,7 +4560,10 @@
bool key_is_smi = instr->hydrogen()->key()->representation().IsSmi();
int base_offset = instr->base_offset();
- if (elements_kind == FLOAT32_ELEMENTS || elements_kind == FLOAT64_ELEMENTS) {
+ if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
+ elements_kind == FLOAT32_ELEMENTS ||
+ elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
+ elements_kind == FLOAT64_ELEMENTS) {
Register address = scratch0();
DoubleRegister value(ToDoubleRegister(instr->value()));
if (key_is_constant) {
@@ -4561,7 +4577,8 @@
__ IndexToArrayOffset(r0, key, element_size_shift, key_is_smi);
__ add(address, external_pointer, r0);
}
- if (elements_kind == FLOAT32_ELEMENTS) {
+ if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
+ elements_kind == FLOAT32_ELEMENTS) {
__ frsp(double_scratch0(), value);
__ stfs(double_scratch0(), MemOperand(address, base_offset));
} else { // Storing doubles, not floats.
@@ -4573,6 +4590,9 @@
PrepareKeyedOperand(key, external_pointer, key_is_constant, key_is_smi,
constant_key, element_size_shift, base_offset);
switch (elements_kind) {
+ case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
+ case EXTERNAL_INT8_ELEMENTS:
+ case EXTERNAL_UINT8_ELEMENTS:
case UINT8_ELEMENTS:
case UINT8_CLAMPED_ELEMENTS:
case INT8_ELEMENTS:
@@ -4582,6 +4602,8 @@
__ stbx(value, mem_operand);
}
break;
+ case EXTERNAL_INT16_ELEMENTS:
+ case EXTERNAL_UINT16_ELEMENTS:
case INT16_ELEMENTS:
case UINT16_ELEMENTS:
if (key_is_constant) {
@@ -4590,6 +4612,8 @@
__ sthx(value, mem_operand);
}
break;
+ case EXTERNAL_INT32_ELEMENTS:
+ case EXTERNAL_UINT32_ELEMENTS:
case INT32_ELEMENTS:
case UINT32_ELEMENTS:
if (key_is_constant) {
@@ -4600,6 +4624,8 @@
break;
case FLOAT32_ELEMENTS:
case FLOAT64_ELEMENTS:
+ case EXTERNAL_FLOAT32_ELEMENTS:
+ case EXTERNAL_FLOAT64_ELEMENTS:
case FAST_DOUBLE_ELEMENTS:
case FAST_ELEMENTS:
case FAST_SMI_ELEMENTS:
@@ -4717,7 +4743,7 @@
void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
// By cases: external, fast double
- if (instr->is_fixed_typed_array()) {
+ if (instr->is_typed_elements()) {
DoStoreKeyedExternalArray(instr);
} else if (instr->hydrogen()->value()->representation().IsDouble()) {
DoStoreKeyedFixedDoubleArray(instr);
« no previous file with comments | « src/objects-printer.cc ('k') | src/ppc/lithium-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698