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

Unified Diff: src/hydrogen-instructions.h

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, 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/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 63ddf2789ac0ebb5f198d76aa4338e0f05ac8928..7a2367cba1c2e614975d820e6ba35076794fc45d 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -6244,11 +6244,6 @@ class HObjectAccess final {
JSArrayBuffer::kBitFieldSlot, Representation::Smi());
}
- static HObjectAccess ForExternalArrayExternalPointer() {
- return HObjectAccess::ForObservableJSObjectOffset(
- ExternalArray::kExternalPointerOffset, Representation::External());
- }
-
static HObjectAccess ForJSArrayBufferViewBuffer() {
return HObjectAccess::ForObservableJSObjectOffset(
JSArrayBufferView::kBufferOffset);
@@ -6618,15 +6613,9 @@ class HLoadKeyed final : public HTemplateInstruction<3>,
DECLARE_INSTRUCTION_FACTORY_P6(HLoadKeyed, HValue*, HValue*, HValue*,
ElementsKind, LoadKeyedHoleMode, int);
- bool is_external() const {
- return IsExternalArrayElementsKind(elements_kind());
- }
bool is_fixed_typed_array() const {
return IsFixedTypedArrayElementsKind(elements_kind());
}
- bool is_typed_elements() const {
- return is_external() || is_fixed_typed_array();
- }
HValue* elements() const { return OperandAt(0); }
HValue* key() const { return OperandAt(1); }
HValue* dependency() const {
@@ -6657,8 +6646,8 @@ class HLoadKeyed final : public HTemplateInstruction<3>,
// kind_fixed_typed_array: external[int32] (none)
// kind_external: external[int32] (none)
if (index == 0) {
- return is_typed_elements() ? Representation::External()
- : Representation::Tagged();
+ return is_fixed_typed_array() ? Representation::External()
+ : Representation::Tagged();
}
if (index == 1) {
return ArrayInstructionInterface::KeyedAccessIndexRequirement(
@@ -6707,7 +6696,7 @@ class HLoadKeyed final : public HTemplateInstruction<3>,
SetOperandAt(1, key);
SetOperandAt(2, dependency != NULL ? dependency : obj);
- if (!is_typed_elements()) {
+ if (!is_fixed_typed_array()) {
// I can detect the case between storing double (holey and fast) and
// smi/object by looking at elements_kind_.
DCHECK(IsFastSmiOrObjectElementsKind(elements_kind) ||
@@ -6733,18 +6722,15 @@ class HLoadKeyed final : public HTemplateInstruction<3>,
SetDependsOnFlag(kDoubleArrayElements);
}
} else {
- if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
- elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
- elements_kind == FLOAT32_ELEMENTS ||
+ if (elements_kind == FLOAT32_ELEMENTS ||
elements_kind == FLOAT64_ELEMENTS) {
set_representation(Representation::Double());
} else {
set_representation(Representation::Integer32());
}
- if (is_external()) {
+ if (is_fixed_typed_array()) {
SetDependsOnFlag(kExternalMemory);
- } else if (is_fixed_typed_array()) {
SetDependsOnFlag(kTypedArrayElements);
} else {
UNREACHABLE();
@@ -7113,8 +7099,8 @@ class HStoreKeyed final : public HTemplateInstruction<3>,
// kind_fixed_typed_array: tagged[int32] = (double | int32)
// kind_external: external[int32] = (double | int32)
if (index == 0) {
- return is_typed_elements() ? Representation::External()
- : Representation::Tagged();
+ return is_fixed_typed_array() ? Representation::External()
+ : Representation::Tagged();
} else if (index == 1) {
return ArrayInstructionInterface::KeyedAccessIndexRequirement(
OperandAt(1)->representation());
@@ -7139,24 +7125,16 @@ class HStoreKeyed final : public HTemplateInstruction<3>,
return Representation::Smi();
}
- return IsExternalArrayElementsKind(kind) ||
- IsFixedTypedArrayElementsKind(kind)
- ? Representation::Integer32()
- : Representation::Tagged();
- }
-
- bool is_external() const {
- return IsExternalArrayElementsKind(elements_kind());
+ if (IsFixedTypedArrayElementsKind(kind)) {
+ return Representation::Integer32();
+ }
+ return Representation::Tagged();
}
bool is_fixed_typed_array() const {
return IsFixedTypedArrayElementsKind(elements_kind());
}
- bool is_typed_elements() const {
- return is_external() || is_fixed_typed_array();
- }
-
Representation observed_input_representation(int index) override {
if (index < 2) return RequiredInputRepresentation(index);
if (IsUninitialized()) {
@@ -7246,25 +7224,20 @@ class HStoreKeyed final : public HTemplateInstruction<3>,
SetFlag(kTrackSideEffectDominators);
SetDependsOnFlag(kNewSpacePromotion);
}
- if (is_external()) {
- SetChangesFlag(kExternalMemory);
- SetFlag(kAllowUndefinedAsNaN);
- } else if (IsFastDoubleElementsKind(elements_kind)) {
+ if (IsFastDoubleElementsKind(elements_kind)) {
SetChangesFlag(kDoubleArrayElements);
} else if (IsFastSmiElementsKind(elements_kind)) {
SetChangesFlag(kArrayElements);
} else if (is_fixed_typed_array()) {
SetChangesFlag(kTypedArrayElements);
+ SetChangesFlag(kExternalMemory);
SetFlag(kAllowUndefinedAsNaN);
} else {
SetChangesFlag(kArrayElements);
}
- // EXTERNAL_{UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating.
- if ((elements_kind >= EXTERNAL_INT8_ELEMENTS &&
- elements_kind <= EXTERNAL_UINT32_ELEMENTS) ||
- (elements_kind >= UINT8_ELEMENTS &&
- elements_kind <= INT32_ELEMENTS)) {
+ // {UNSIGNED_,}{BYTE,SHORT,INT}_ELEMENTS are truncating.
+ if (elements_kind >= UINT8_ELEMENTS && elements_kind <= INT32_ELEMENTS) {
SetFlag(kTruncatingToInt32);
}
}
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698