Index: test/unittests/compiler/js-typed-lowering-unittest.cc |
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc |
index c5f2a82cf786f6bed5268543b3638946934cd521..1596bac5e6b94cb801b682ca2600905398f2a873 100644 |
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc |
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc |
@@ -650,34 +650,37 @@ TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArray) { |
NewArrayBuffer(backing_store, sizeof(backing_store)); |
VectorSlotPair feedback; |
TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { |
- Handle<JSTypedArray> array = |
- factory()->NewJSTypedArray(type, buffer, 0, kLength); |
- int const element_size = static_cast<int>(array->element_size()); |
- |
- Node* key = Parameter( |
- Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
- Node* base = HeapConstant(array); |
- Node* vector = UndefinedConstant(); |
- Node* context = UndefinedConstant(); |
- Node* effect = graph()->start(); |
- Node* control = graph()->start(); |
- Reduction r = Reduce(graph()->NewNode( |
- javascript()->LoadProperty(feedback), base, key, vector, context, |
- EmptyFrameState(), EmptyFrameState(), effect, control)); |
+ TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { |
+ Handle<JSTypedArray> array = |
+ factory()->NewJSTypedArray(type, buffer, 0, kLength); |
+ int const element_size = static_cast<int>(array->element_size()); |
- Matcher<Node*> offset_matcher = |
- element_size == 1 |
- ? key |
- : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); |
+ Node* key = Parameter( |
+ Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
+ Node* base = HeapConstant(array); |
+ Node* vector = UndefinedConstant(); |
+ Node* context = UndefinedConstant(); |
+ Node* effect = graph()->start(); |
+ Node* control = graph()->start(); |
+ Reduction r = Reduce( |
+ graph()->NewNode(javascript()->LoadProperty(feedback, language_mode), |
+ base, key, vector, context, EmptyFrameState(), |
+ EmptyFrameState(), effect, control)); |
- ASSERT_TRUE(r.Changed()); |
- EXPECT_THAT( |
- r.replacement(), |
- IsLoadBuffer(BufferAccess(type), |
- IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
- offset_matcher, |
- IsNumberConstant(array->byte_length()->Number()), effect, |
- control)); |
+ Matcher<Node*> offset_matcher = |
+ element_size == 1 |
+ ? key |
+ : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); |
+ |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT( |
+ r.replacement(), |
+ IsLoadBuffer(BufferAccess(type), |
+ IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
+ offset_matcher, |
+ IsNumberConstant(array->byte_length()->Number()), effect, |
+ control)); |
+ } |
} |
} |
@@ -689,29 +692,32 @@ TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArrayWithSafeKey) { |
NewArrayBuffer(backing_store, sizeof(backing_store)); |
VectorSlotPair feedback; |
TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { |
- Handle<JSTypedArray> array = |
- factory()->NewJSTypedArray(type, buffer, 0, kLength); |
- ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true); |
- |
- int min = random_number_generator()->NextInt(static_cast<int>(kLength)); |
- int max = random_number_generator()->NextInt(static_cast<int>(kLength)); |
- if (min > max) std::swap(min, max); |
- Node* key = Parameter(Type::Range(min, max, zone())); |
- Node* base = HeapConstant(array); |
- Node* vector = UndefinedConstant(); |
- Node* context = UndefinedConstant(); |
- Node* effect = graph()->start(); |
- Node* control = graph()->start(); |
- Reduction r = Reduce(graph()->NewNode( |
- javascript()->LoadProperty(feedback), base, key, vector, context, |
- EmptyFrameState(), EmptyFrameState(), effect, control)); |
+ TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { |
+ Handle<JSTypedArray> array = |
+ factory()->NewJSTypedArray(type, buffer, 0, kLength); |
+ ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true); |
- ASSERT_TRUE(r.Changed()); |
- EXPECT_THAT( |
- r.replacement(), |
- IsLoadElement(access, |
- IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
- key, effect, control)); |
+ int min = random_number_generator()->NextInt(static_cast<int>(kLength)); |
+ int max = random_number_generator()->NextInt(static_cast<int>(kLength)); |
+ if (min > max) std::swap(min, max); |
+ Node* key = Parameter(Type::Range(min, max, zone())); |
+ Node* base = HeapConstant(array); |
+ Node* vector = UndefinedConstant(); |
+ Node* context = UndefinedConstant(); |
+ Node* effect = graph()->start(); |
+ Node* control = graph()->start(); |
+ Reduction r = Reduce( |
+ graph()->NewNode(javascript()->LoadProperty(feedback, language_mode), |
+ base, key, vector, context, EmptyFrameState(), |
+ EmptyFrameState(), effect, control)); |
+ |
+ ASSERT_TRUE(r.Changed()); |
+ EXPECT_THAT( |
+ r.replacement(), |
+ IsLoadElement(access, |
+ IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
+ key, effect, control)); |
+ } |
} |
} |