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

Unified Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 650843002: [turbofan] Embed the actual backing store address for typed loads/stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment. Created 6 years, 2 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/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bba4d653321d6228d52b1b88f280d7985e04fa34..a52626f6f4a40436242c9fb50c4168f4ed980bb0 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -11,12 +11,7 @@
#include "src/compiler/typer.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/graph-unittest.h"
-#include "testing/gmock-support.h"
-
-using testing::_;
-using testing::AllOf;
-using testing::Capture;
-using testing::CaptureEq;
+#include "testing/gtest-support.h"
namespace v8 {
namespace internal {
@@ -62,6 +57,11 @@ class JSTypedLoweringTest : public GraphTest {
return buffer;
}
+ Matcher<Node*> IsIntPtrConstant(intptr_t value) {
+ return sizeof(value) == 4 ? IsInt32Constant(static_cast<int32_t>(value))
+ : IsInt64Constant(static_cast<int64_t>(value));
+ }
+
JSOperatorBuilder* javascript() { return &javascript_; }
private:
@@ -98,18 +98,13 @@ TEST_F(JSTypedLoweringTest, JSLoadPropertyFromExternalTypedArray) {
node->AppendInput(zone(), control);
Reduction r = Reduce(node);
- Capture<Node*> elements;
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
- IsLoadElement(
- AccessBuilder::ForTypedArrayElement(type, true),
- IsLoadField(AccessBuilder::ForExternalArrayPointer(),
- AllOf(CaptureEq(&elements),
- IsLoadField(AccessBuilder::ForJSObjectElements(),
- base, _)),
- CaptureEq(&elements)),
- key, IsInt32Constant(static_cast<int>(kLength)), effect, control));
+ IsLoadElement(AccessBuilder::ForTypedArrayElement(type, true),
+ IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
+ key, IsInt32Constant(static_cast<int>(kLength)), effect,
+ control));
}
}
@@ -143,20 +138,13 @@ TEST_F(JSTypedLoweringTest, JSStorePropertyToExternalTypedArray) {
node->AppendInput(zone(), control);
Reduction r = Reduce(node);
- Capture<Node*> elements;
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(
- r.replacement(),
- IsStoreElement(
- AccessBuilder::ForTypedArrayElement(type, true),
- IsLoadField(
- AccessBuilder::ForExternalArrayPointer(),
- AllOf(CaptureEq(&elements),
- IsLoadField(AccessBuilder::ForJSObjectElements(), base,
- _)),
- CaptureEq(&elements)),
- key, IsInt32Constant(static_cast<int>(kLength)), value, effect,
- control));
+ EXPECT_THAT(r.replacement(),
+ IsStoreElement(
+ AccessBuilder::ForTypedArrayElement(type, true),
+ IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
+ key, IsInt32Constant(static_cast<int>(kLength)), value,
+ effect, control));
}
}
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698