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

Unified Diff: test/unittests/compiler/interpreter-assembler-unittest.cc

Issue 1422033002: [Interpreter] Add support for for..in. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment nits. Created 5 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
Index: test/unittests/compiler/interpreter-assembler-unittest.cc
diff --git a/test/unittests/compiler/interpreter-assembler-unittest.cc b/test/unittests/compiler/interpreter-assembler-unittest.cc
index 82ec7120e6887d4a93c32e78aae78868c9a841b7..2a844f3215d49b9d52518d4a79bfb6ba2e572840 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -471,6 +471,36 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) {
}
+TARGET_TEST_F(InterpreterAssemblerTest, LoadFixedArrayElement) {
+ TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ int index = 3;
+ Node* fixed_array = m.IntPtrConstant(0xdeadbeef);
+ Node* load_element = m.LoadFixedArrayElement(fixed_array, index);
+ EXPECT_THAT(
+ load_element,
+ m.IsLoad(kMachAnyTagged, fixed_array,
+ IsIntPtrAdd(
+ IsIntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
+ IsWordShl(IsInt32Constant(index),
+ IsInt32Constant(kPointerSizeLog2)))));
+ }
+}
+
+
+TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) {
+ TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ Node* object = m.IntPtrConstant(0xdeadbeef);
+ int offset = 16;
+ Node* load_field = m.LoadObjectField(object, offset);
+ EXPECT_THAT(load_field,
+ m.IsLoad(kMachAnyTagged, object,
+ IsIntPtrConstant(offset - kHeapObjectTag)));
+ }
+}
+
+
TARGET_TEST_F(InterpreterAssemblerTest, LoadContextSlot) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);
@@ -505,19 +535,6 @@ TARGET_TEST_F(InterpreterAssemblerTest, StoreContextSlot) {
}
-TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) {
- TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
- InterpreterAssemblerForTest m(this, bytecode);
- Node* object = m.IntPtrConstant(0xdeadbeef);
- int offset = 16;
- Node* load_field = m.LoadObjectField(object, offset);
- EXPECT_THAT(load_field,
- m.IsLoad(kMachAnyTagged, object,
- IsIntPtrConstant(offset - kHeapObjectTag)));
- }
-}
-
-
TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);

Powered by Google App Engine
This is Rietveld 408576698