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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1400353002: [Interpreter]: Use vector store for array literal computed stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 4046832fa95155036fd532050b01a075f9ed8543..70cb1260786def5ea66b15e254267b7c6389a71b 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -1951,6 +1951,15 @@ TEST(FunctionLiterals) {
TEST(ArrayLiterals) {
InitializedHandleScope handle_scope;
BytecodeGeneratorHelper helper;
+ Zone zone;
+
+ FeedbackVectorSpec feedback_spec(&zone);
+ FeedbackVectorSlot slot1 = feedback_spec.AddKeyedStoreICSlot();
+ FeedbackVectorSlot slot2 = feedback_spec.AddKeyedStoreICSlot();
+ FeedbackVectorSlot slot3 = feedback_spec.AddKeyedStoreICSlot();
+
+ Handle<i::TypeFeedbackVector> vector =
+ i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
int simple_flags =
ArrayLiteral::kDisableMementos | ArrayLiteral::kShallowElements;
@@ -1970,26 +1979,26 @@ TEST(ArrayLiterals) {
{"var a = 1; return [ a, a + 1 ];",
4 * kPointerSize,
1,
- 37,
- {
- B(LdaSmi8), U8(1), //
- B(Star), R(0), //
- B(LdaConstant), U8(0), //
- B(CreateArrayLiteral), U8(0), U8(3), //
- B(Star), R(2), //
- B(LdaZero), //
- B(Star), R(1), //
- B(Ldar), R(0), //
- B(KeyedStoreICGeneric), R(2), R(1), //
- B(LdaSmi8), U8(1), //
- B(Star), R(1), //
- B(Ldar), R(0), //
- B(Star), R(3), //
- B(LdaSmi8), U8(1), //
- B(Add), R(3), //
- B(KeyedStoreICGeneric), R(2), R(1), //
- B(Ldar), R(2), //
- B(Return) //
+ 39,
+ {
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateArrayLiteral), U8(0), U8(3), //
+ B(Star), R(2), //
+ B(LdaZero), //
+ B(Star), R(1), //
+ B(Ldar), R(0), //
+ B(KeyedStoreICSloppy), R(2), R(1), U8(vector->GetIndex(slot1)), //
+ B(LdaSmi8), U8(1), //
+ B(Star), R(1), //
+ B(Ldar), R(0), //
+ B(Star), R(3), //
+ B(LdaSmi8), U8(1), //
+ B(Add), R(3), //
+ B(KeyedStoreICSloppy), R(2), R(1), U8(vector->GetIndex(slot1)), //
+ B(Ldar), R(2), //
+ B(Return) //
},
1,
{InstanceType::FIXED_ARRAY_TYPE}},
@@ -2007,40 +2016,40 @@ TEST(ArrayLiterals) {
{"var a = 1; return [ [ a, 2 ], [ a + 2 ] ];",
6 * kPointerSize,
1,
- 67,
+ 71,
{
- B(LdaSmi8), U8(1), //
- B(Star), R(0), //
- B(LdaConstant), U8(0), //
- B(CreateArrayLiteral), U8(2), U8(deep_elements_flags), //
- B(Star), R(2), //
- B(LdaZero), //
- B(Star), R(1), //
- B(LdaConstant), U8(1), //
- B(CreateArrayLiteral), U8(0), U8(simple_flags), //
- B(Star), R(4), //
- B(LdaZero), //
- B(Star), R(3), //
- B(Ldar), R(0), //
- B(KeyedStoreICGeneric), R(4), R(3), //
- B(Ldar), R(4), //
- B(KeyedStoreICGeneric), R(2), R(1), //
- B(LdaSmi8), U8(1), //
- B(Star), R(1), //
- B(LdaConstant), U8(2), //
- B(CreateArrayLiteral), U8(1), U8(simple_flags), //
- B(Star), R(4), //
- B(LdaZero), //
- B(Star), R(3), //
- B(Ldar), R(0), //
- B(Star), R(5), //
- B(LdaSmi8), U8(2), //
- B(Add), R(5), //
- B(KeyedStoreICGeneric), R(4), R(3), //
- B(Ldar), R(4), //
- B(KeyedStoreICGeneric), R(2), R(1), //
- B(Ldar), R(2), //
- B(Return), //
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateArrayLiteral), U8(2), U8(deep_elements_flags), //
+ B(Star), R(2), //
+ B(LdaZero), //
+ B(Star), R(1), //
+ B(LdaConstant), U8(1), //
+ B(CreateArrayLiteral), U8(0), U8(simple_flags), //
+ B(Star), R(4), //
+ B(LdaZero), //
+ B(Star), R(3), //
+ B(Ldar), R(0), //
+ B(KeyedStoreICSloppy), R(4), R(3), U8(vector->GetIndex(slot1)), //
+ B(Ldar), R(4), //
+ B(KeyedStoreICSloppy), R(2), R(1), U8(vector->GetIndex(slot3)), //
+ B(LdaSmi8), U8(1), //
+ B(Star), R(1), //
+ B(LdaConstant), U8(2), //
+ B(CreateArrayLiteral), U8(1), U8(simple_flags), //
+ B(Star), R(4), //
+ B(LdaZero), //
+ B(Star), R(3), //
+ B(Ldar), R(0), //
+ B(Star), R(5), //
+ B(LdaSmi8), U8(2), //
+ B(Add), R(5), //
+ B(KeyedStoreICSloppy), R(4), R(3), U8(vector->GetIndex(slot2)), //
+ B(Ldar), R(4), //
+ B(KeyedStoreICSloppy), R(2), R(1), U8(vector->GetIndex(slot3)), //
+ B(Ldar), R(2), //
+ B(Return), //
},
3,
{InstanceType::FIXED_ARRAY_TYPE, InstanceType::FIXED_ARRAY_TYPE,
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698