Commit 67383fe7 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

[turbofan] Add BoundsCheckMode to ElementAccess.

This is currently only used for StoreElement. LoadElement will be
updated to make use of that in a follow-up CL (depends on additional
control input for loads first).

TEST=cctest,mjsunit
R=jarin@chromium.org, mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/617853002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24347 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 63851465
...@@ -53,7 +53,8 @@ FieldAccess AccessBuilder::ForExternalArrayPointer() { ...@@ -53,7 +53,8 @@ FieldAccess AccessBuilder::ForExternalArrayPointer() {
// static // static
ElementAccess AccessBuilder::ForFixedArrayElement() { ElementAccess AccessBuilder::ForFixedArrayElement() {
return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged}; return {kNoBoundsCheck, kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
kMachAnyTagged};
} }
...@@ -64,25 +65,33 @@ ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type, ...@@ -64,25 +65,33 @@ ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset; int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset;
switch (type) { switch (type) {
case kExternalInt8Array: case kExternalInt8Array:
return {taggedness, header_size, Type::Signed32(), kMachInt8}; return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
kMachInt8};
case kExternalUint8Array: case kExternalUint8Array:
case kExternalUint8ClampedArray: case kExternalUint8ClampedArray:
return {taggedness, header_size, Type::Unsigned32(), kMachUint8}; return {kTypedArrayBoundsCheck, taggedness, header_size,
Type::Unsigned32(), kMachUint8};
case kExternalInt16Array: case kExternalInt16Array:
return {taggedness, header_size, Type::Signed32(), kMachInt16}; return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
kMachInt16};
case kExternalUint16Array: case kExternalUint16Array:
return {taggedness, header_size, Type::Unsigned32(), kMachUint16}; return {kTypedArrayBoundsCheck, taggedness, header_size,
Type::Unsigned32(), kMachUint16};
case kExternalInt32Array: case kExternalInt32Array:
return {taggedness, header_size, Type::Signed32(), kMachInt32}; return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Signed32(),
kMachInt32};
case kExternalUint32Array: case kExternalUint32Array:
return {taggedness, header_size, Type::Unsigned32(), kMachUint32}; return {kTypedArrayBoundsCheck, taggedness, header_size,
Type::Unsigned32(), kMachUint32};
case kExternalFloat32Array: case kExternalFloat32Array:
return {taggedness, header_size, Type::Number(), kRepFloat32}; return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Number(),
kRepFloat32};
case kExternalFloat64Array: case kExternalFloat64Array:
return {taggedness, header_size, Type::Number(), kRepFloat64}; return {kTypedArrayBoundsCheck, taggedness, header_size, Type::Number(),
kRepFloat64};
} }
UNREACHABLE(); UNREACHABLE();
return {kUntaggedBase, 0, Type::None(), kMachNone}; return {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::None(), kMachNone};
} }
} // namespace compiler } // namespace compiler
......
...@@ -597,26 +597,12 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) { ...@@ -597,26 +597,12 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) {
DCHECK(IsFixedTypedArrayElementsKind(elements_kind)); DCHECK(IsFixedTypedArrayElementsKind(elements_kind));
element_access = AccessBuilder::ForTypedArrayElement(type, false); element_access = AccessBuilder::ForTypedArrayElement(type, false);
} }
Node* check = graph()->NewNode(machine()->Uint32LessThan(), key,
jsgraph()->Uint32Constant(length));
Node* branch = graph()->NewNode(common()->Branch(), check,
NodeProperties::GetControlInput(node));
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* store = Node* store =
graph()->NewNode(simplified()->StoreElement(element_access), elements, graph()->NewNode(simplified()->StoreElement(element_access), elements,
key, jsgraph()->Uint32Constant(length), value, key, jsgraph()->Uint32Constant(length), value,
NodeProperties::GetEffectInput(node), if_true); NodeProperties::GetEffectInput(node),
NodeProperties::GetControlInput(node));
Node* if_false = graph()->NewNode(common()->IfFalse(), branch); return ReplaceEagerly(node, store);
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* phi = graph()->NewNode(common()->EffectPhi(2), store,
NodeProperties::GetEffectInput(node), merge);
return ReplaceWith(phi);
} }
return NoChange(); return NoChange();
} }
......
...@@ -876,12 +876,41 @@ void SimplifiedLowering::DoLoadElement(Node* node) { ...@@ -876,12 +876,41 @@ void SimplifiedLowering::DoLoadElement(Node* node) {
void SimplifiedLowering::DoStoreElement(Node* node) { void SimplifiedLowering::DoStoreElement(Node* node) {
const ElementAccess& access = ElementAccessOf(node->op()); const ElementAccess& access = ElementAccessOf(node->op());
WriteBarrierKind kind = ComputeWriteBarrierKind( const Operator* op = machine()->Store(StoreRepresentation(
access.base_is_tagged, access.machine_type, access.type); access.machine_type,
node->set_op( ComputeWriteBarrierKind(access.base_is_tagged, access.machine_type,
machine()->Store(StoreRepresentation(access.machine_type, kind))); access.type)));
node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1))); Node* key = node->InputAt(1);
node->RemoveInput(2); Node* index = ComputeIndex(access, key);
if (access.bounds_check == kNoBoundsCheck) {
node->set_op(op);
node->ReplaceInput(1, index);
node->RemoveInput(2);
} else {
DCHECK_EQ(kTypedArrayBoundsCheck, access.bounds_check);
Node* base = node->InputAt(0);
Node* length = node->InputAt(2);
Node* value = node->InputAt(3);
Node* effect = node->InputAt(4);
Node* control = node->InputAt(5);
Node* check = graph()->NewNode(machine()->Uint32LessThan(), key, length);
Node* branch = graph()->NewNode(common()->Branch(), check, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* store = graph()->NewNode(op, base, index, value, effect, if_true);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
node->set_op(common()->EffectPhi(2));
node->ReplaceInput(0, store);
node->ReplaceInput(1, effect);
node->ReplaceInput(2, merge);
node->TrimInputCount(3);
}
} }
......
...@@ -119,43 +119,44 @@ INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest, ...@@ -119,43 +119,44 @@ INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedPureOperatorTest,
namespace { namespace {
const ElementAccess kElementAccesses[] = { const ElementAccess kElementAccesses[] = {
{kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged}, {kNoBoundsCheck, kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), kMachAnyTagged},
kMachInt8}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), Type::Any(), kMachInt8},
kMachInt16}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), Type::Any(), kMachInt16},
kMachInt32}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), Type::Any(), kMachInt32},
kMachUint8}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), Type::Any(), kMachUint8},
kMachUint16}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(), Type::Any(), kMachUint16},
kMachUint32}, {kNoBoundsCheck, kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
{kUntaggedBase, 0, Type::Signed32(), kMachInt8}, Type::Any(), kMachUint32},
{kUntaggedBase, 0, Type::Unsigned32(), kMachUint8}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt8},
{kUntaggedBase, 0, Type::Signed32(), kMachInt16}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint8},
{kUntaggedBase, 0, Type::Unsigned32(), kMachUint16}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt16},
{kUntaggedBase, 0, Type::Signed32(), kMachInt32}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint16},
{kUntaggedBase, 0, Type::Unsigned32(), kMachUint32}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Signed32(), kMachInt32},
{kUntaggedBase, 0, Type::Number(), kRepFloat32}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Unsigned32(), kMachUint32},
{kUntaggedBase, 0, Type::Number(), kRepFloat64}, {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Number(), kRepFloat32},
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), {kTypedArrayBoundsCheck, kUntaggedBase, 0, Type::Number(), kRepFloat64},
kMachInt8}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), Type::Signed32(), kMachInt8},
kMachUint8}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), Type::Unsigned32(), kMachUint8},
kMachInt16}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), Type::Signed32(), kMachInt16},
kMachUint16}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Signed32(), Type::Unsigned32(), kMachUint16},
kMachInt32}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Unsigned32(), Type::Signed32(), kMachInt32},
kMachUint32}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), Type::Unsigned32(), kMachUint32},
kRepFloat32}, {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
{kTaggedBase, FixedTypedArrayBase::kDataOffset, Type::Number(), Type::Number(), kRepFloat32},
kRepFloat64}}; {kTypedArrayBoundsCheck, kTaggedBase, FixedTypedArrayBase::kDataOffset,
Type::Number(), kRepFloat64}};
} // namespace } // namespace
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "src/compiler/simplified-operator.h" #include "src/compiler/simplified-operator.h"
#include <ostream> // NOLINT(readability/streams)
#include "src/base/lazy-instance.h" #include "src/base/lazy-instance.h"
#include "src/compiler/opcodes.h" #include "src/compiler/opcodes.h"
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
...@@ -25,6 +27,18 @@ std::ostream& operator<<(std::ostream& os, BaseTaggedness base_taggedness) { ...@@ -25,6 +27,18 @@ std::ostream& operator<<(std::ostream& os, BaseTaggedness base_taggedness) {
} }
std::ostream& operator<<(std::ostream& os, BoundsCheckMode bounds_check_mode) {
switch (bounds_check_mode) {
case kNoBoundsCheck:
return os << "no bounds check";
case kTypedArrayBoundsCheck:
return os << "ignore out of bounds";
}
UNREACHABLE();
return os;
}
bool operator==(ElementAccess const& lhs, ElementAccess const& rhs) { bool operator==(ElementAccess const& lhs, ElementAccess const& rhs) {
return lhs.base_is_tagged == rhs.base_is_tagged && return lhs.base_is_tagged == rhs.base_is_tagged &&
lhs.header_size == rhs.header_size && lhs.type == rhs.type && lhs.header_size == rhs.header_size && lhs.type == rhs.type &&
...@@ -40,7 +54,7 @@ bool operator!=(ElementAccess const& lhs, ElementAccess const& rhs) { ...@@ -40,7 +54,7 @@ bool operator!=(ElementAccess const& lhs, ElementAccess const& rhs) {
std::ostream& operator<<(std::ostream& os, ElementAccess const& access) { std::ostream& operator<<(std::ostream& os, ElementAccess const& access) {
os << "[" << access.base_is_tagged << ", " << access.header_size << ", "; os << "[" << access.base_is_tagged << ", " << access.header_size << ", ";
access.type->PrintTo(os); access.type->PrintTo(os);
os << ", " << access.machine_type << "]"; os << ", " << access.machine_type << ", " << access.bounds_check << "]";
return os; return os;
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_ #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_
#define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_
#include <iosfwd>
#include "src/compiler/machine-type.h" #include "src/compiler/machine-type.h"
#include "src/handles.h" #include "src/handles.h"
...@@ -44,11 +46,17 @@ struct FieldAccess { ...@@ -44,11 +46,17 @@ struct FieldAccess {
}; };
enum BoundsCheckMode { kNoBoundsCheck, kTypedArrayBoundsCheck };
std::ostream& operator<<(std::ostream&, BoundsCheckMode);
// An access descriptor for loads/stores of indexed structures like characters // An access descriptor for loads/stores of indexed structures like characters
// in strings or off-heap backing stores. Accesses from either tagged or // in strings or off-heap backing stores. Accesses from either tagged or
// untagged base pointers are supported; untagging is done automatically during // untagged base pointers are supported; untagging is done automatically during
// lowering. // lowering.
struct ElementAccess { struct ElementAccess {
BoundsCheckMode bounds_check; // specifies the bounds checking mode.
BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged. BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged.
int header_size; // size of the header, without tag. int header_size; // size of the header, without tag.
Type* type; // type of the element. Type* type; // type of the element.
......
...@@ -325,8 +325,8 @@ TEST(RunLoadElementFromUntaggedBase) { ...@@ -325,8 +325,8 @@ TEST(RunLoadElementFromUntaggedBase) {
for (size_t i = 0; i < arraysize(smis); i++) { // for header sizes for (size_t i = 0; i < arraysize(smis); i++) { // for header sizes
for (size_t j = 0; (i + j) < arraysize(smis); j++) { // for element index for (size_t j = 0; (i + j) < arraysize(smis); j++) { // for element index
int offset = static_cast<int>(i * sizeof(Smi*)); int offset = static_cast<int>(i * sizeof(Smi*));
ElementAccess access = {kUntaggedBase, offset, Type::Integral32(), ElementAccess access = {kNoBoundsCheck, kUntaggedBase, offset,
kMachAnyTagged}; Type::Integral32(), kMachAnyTagged};
SimplifiedLoweringTester<Object*> t; SimplifiedLoweringTester<Object*> t;
Node* load = t.LoadElement( Node* load = t.LoadElement(
...@@ -354,8 +354,8 @@ TEST(RunStoreElementFromUntaggedBase) { ...@@ -354,8 +354,8 @@ TEST(RunStoreElementFromUntaggedBase) {
for (size_t i = 0; i < arraysize(smis); i++) { // for header sizes for (size_t i = 0; i < arraysize(smis); i++) { // for header sizes
for (size_t j = 0; (i + j) < arraysize(smis); j++) { // for element index for (size_t j = 0; (i + j) < arraysize(smis); j++) { // for element index
int offset = static_cast<int>(i * sizeof(Smi*)); int offset = static_cast<int>(i * sizeof(Smi*));
ElementAccess access = {kUntaggedBase, offset, Type::Integral32(), ElementAccess access = {kNoBoundsCheck, kUntaggedBase, offset,
kMachAnyTagged}; Type::Integral32(), kMachAnyTagged};
SimplifiedLoweringTester<Object*> t(kMachAnyTagged); SimplifiedLoweringTester<Object*> t(kMachAnyTagged);
Node* p0 = t.Parameter(0); Node* p0 = t.Parameter(0);
...@@ -517,9 +517,9 @@ class AccessTester : public HandleAndZoneScope { ...@@ -517,9 +517,9 @@ class AccessTester : public HandleAndZoneScope {
private: private:
ElementAccess GetElementAccess() { ElementAccess GetElementAccess() {
ElementAccess access = {tagged ? kTaggedBase : kUntaggedBase, ElementAccess access = {
tagged ? FixedArrayBase::kHeaderSize : 0, kNoBoundsCheck, tagged ? kTaggedBase : kUntaggedBase,
Type::Any(), rep}; tagged ? FixedArrayBase::kHeaderSize : 0, Type::Any(), rep};
return access; return access;
} }
...@@ -1349,8 +1349,9 @@ TEST(LowerLoadElement_to_load) { ...@@ -1349,8 +1349,9 @@ TEST(LowerLoadElement_to_load) {
TestingGraph t(Type::Any(), Type::Signed32()); TestingGraph t(Type::Any(), Type::Signed32());
for (size_t i = 0; i < arraysize(machine_reps); i++) { for (size_t i = 0; i < arraysize(machine_reps); i++) {
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, ElementAccess access = {kNoBoundsCheck, kTaggedBase,
Type::Any(), machine_reps[i]}; FixedArrayBase::kHeaderSize, Type::Any(),
machine_reps[i]};
Node* load = Node* load =
t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0, t.p1, t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0, t.p1,
...@@ -1372,8 +1373,9 @@ TEST(LowerStoreElement_to_store) { ...@@ -1372,8 +1373,9 @@ TEST(LowerStoreElement_to_store) {
TestingGraph t(Type::Any(), Type::Signed32()); TestingGraph t(Type::Any(), Type::Signed32());
for (size_t i = 0; i < arraysize(machine_reps); i++) { for (size_t i = 0; i < arraysize(machine_reps); i++) {
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, ElementAccess access = {kNoBoundsCheck, kTaggedBase,
Type::Any(), machine_reps[i]}; FixedArrayBase::kHeaderSize, Type::Any(),
machine_reps[i]};
Node* val = t.ExampleWithOutput(machine_reps[i]); Node* val = t.ExampleWithOutput(machine_reps[i]);
Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0,
...@@ -1398,7 +1400,8 @@ TEST(InsertChangeForLoadElementIndex) { ...@@ -1398,7 +1400,8 @@ TEST(InsertChangeForLoadElementIndex) {
// LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) => // LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) =>
// Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k)) // Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k))
TestingGraph t(Type::Any(), Type::Signed32(), Type::Any()); TestingGraph t(Type::Any(), Type::Signed32(), Type::Any());
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), ElementAccess access = {kNoBoundsCheck, kTaggedBase,
FixedArrayBase::kHeaderSize, Type::Any(),
kMachAnyTagged}; kMachAnyTagged};
Node* load = t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0, Node* load = t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0,
...@@ -1417,7 +1420,8 @@ TEST(InsertChangeForStoreElementIndex) { ...@@ -1417,7 +1420,8 @@ TEST(InsertChangeForStoreElementIndex) {
// StoreElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length, val) => // StoreElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length, val) =>
// Store(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k), val) // Store(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k), val)
TestingGraph t(Type::Any(), Type::Signed32(), Type::Any()); TestingGraph t(Type::Any(), Type::Signed32(), Type::Any());
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), ElementAccess access = {kNoBoundsCheck, kTaggedBase,
FixedArrayBase::kHeaderSize, Type::Any(),
kMachAnyTagged}; kMachAnyTagged};
Node* store = Node* store =
...@@ -1436,7 +1440,8 @@ TEST(InsertChangeForStoreElementIndex) { ...@@ -1436,7 +1440,8 @@ TEST(InsertChangeForStoreElementIndex) {
TEST(InsertChangeForLoadElement) { TEST(InsertChangeForLoadElement) {
// TODO(titzer): test all load/store representation change insertions. // TODO(titzer): test all load/store representation change insertions.
TestingGraph t(Type::Any(), Type::Signed32(), Type::Any()); TestingGraph t(Type::Any(), Type::Signed32(), Type::Any());
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), ElementAccess access = {kNoBoundsCheck, kTaggedBase,
FixedArrayBase::kHeaderSize, Type::Any(),
kMachFloat64}; kMachFloat64};
Node* load = t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0, Node* load = t.graph()->NewNode(t.simplified()->LoadElement(access), t.p0,
...@@ -1468,7 +1473,8 @@ TEST(InsertChangeForLoadField) { ...@@ -1468,7 +1473,8 @@ TEST(InsertChangeForLoadField) {
TEST(InsertChangeForStoreElement) { TEST(InsertChangeForStoreElement) {
// TODO(titzer): test all load/store representation change insertions. // TODO(titzer): test all load/store representation change insertions.
TestingGraph t(Type::Any(), Type::Signed32(), Type::Any()); TestingGraph t(Type::Any(), Type::Signed32(), Type::Any());
ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), ElementAccess access = {kNoBoundsCheck, kTaggedBase,
FixedArrayBase::kHeaderSize, Type::Any(),
kMachFloat64}; kMachFloat64};
Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment