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

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

Issue 1413703007: [Interpreter] Fix a register allocation bug and add a DCHECK. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename function 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/bytecode-generator.cc ('k') | no next file » | 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 ea1a8b26197630421313713429aa1262bca1662f..2dd5167cb2983d4aa98507724fa4621dc3296089 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -2988,15 +2988,21 @@ TEST(CountOperators) {
FeedbackVectorSpec feedback_spec(&zone);
FeedbackVectorSlot slot1 = feedback_spec.AddLoadICSlot();
FeedbackVectorSlot slot2 = feedback_spec.AddStoreICSlot();
-
Handle<i::TypeFeedbackVector> vector =
i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
+ FeedbackVectorSpec store_feedback_spec(&zone);
+ FeedbackVectorSlot store_slot = store_feedback_spec.AddStoreICSlot();
+ Handle<i::TypeFeedbackVector> store_vector =
+ i::NewTypeFeedbackVector(helper.isolate(), &store_feedback_spec);
+
int closure = Register::function_closure().index();
int first_context_slot = Context::MIN_CONTEXT_SLOTS;
int object_literal_flags =
ObjectLiteral::kFastElements | ObjectLiteral::kDisableMementos;
+ int array_literal_flags =
+ ArrayLiteral::kDisableMementos | ArrayLiteral::kShallowElements;
ExpectedSnippet<InstanceType> snippets[] = {
{"var a = 1; return ++a;",
@@ -3179,6 +3185,28 @@ TEST(CountOperators) {
},
1,
{InstanceType::SHARED_FUNCTION_INFO_TYPE}},
+ {"var idx = 1; var a = [1, 2]; return a[idx++] = 2;",
+ 3 * kPointerSize,
+ 1,
+ 26,
+ {
+ B(LdaSmi8), U8(1), //
+ B(Star), R(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateArrayLiteral), U8(0), U8(array_literal_flags), //
+ B(Star), R(1), //
+ B(Ldar), R(0), //
+ B(ToNumber), //
+ B(Star), R(2), //
+ B(Inc), //
+ B(Star), R(0), //
+ B(LdaSmi8), U8(2), //
+ B(KeyedStoreICSloppy), R(1), R(2), //
+ U8(store_vector->GetIndex(store_slot)), //
+ B(Return), //
+ },
+ 1,
+ {InstanceType::FIXED_ARRAY_TYPE}},
};
for (size_t i = 0; i < arraysize(snippets); i++) {
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698