Chromium Code Reviews

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

Issue 1665833002: [interpreter] Switch context during stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« src/compiler/bytecode-graph-builder.cc ('K') | « src/objects-inl.h ('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 f56b4dca7d0f6fc34ab313d64d3a8a94ceb2bbec..e9ad3d72ae5add41446f6e29a213e67ac9fae11a 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -4261,13 +4261,15 @@ TEST(TryCatch) {
BytecodeGeneratorHelper helper;
int closure = Register::function_closure().index();
+ int context = Register::current_context().index();
ExpectedSnippet<const char*> snippets[] = {
{"try { return 1; } catch(e) { return 2; }",
5 * kPointerSize,
1,
- 36,
+ 39,
{
+ B(Mov), R(context), R(1), //
B(LdaSmi8), U8(1), //
B(Return), //
B(Star), R(3), //
@@ -4291,12 +4293,13 @@ TEST(TryCatch) {
1,
{"e"},
1,
- {{0, 3, 3}}},
+ {{3, 6, 6}}},
{"var a; try { a = 1 } catch(e1) {}; try { a = 2 } catch(e2) { a = 3 }",
6 * kPointerSize,
1,
- 74,
+ 80,
{
+ B(Mov), R(context), R(2), //
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Jump), U8(30), //
@@ -4312,6 +4315,7 @@ TEST(TryCatch) {
B(Ldar), R(2), //
B(PushContext), R(1), //
B(PopContext), R(1), //
+ B(Mov), R(context), R(2), //
B(LdaSmi8), U8(2), //
B(Star), R(0), //
B(Jump), U8(34), //
@@ -4335,7 +4339,7 @@ TEST(TryCatch) {
2,
{"e1", "e2"},
2,
- {{0, 4, 6}, {34, 38, 40}}},
+ {{3, 7, 9}, {40, 44, 46}}},
};
for (size_t i = 0; i < arraysize(snippets); i++) {
@@ -4351,15 +4355,17 @@ TEST(TryFinally) {
BytecodeGeneratorHelper helper;
int closure = Register::function_closure().index();
+ int context = Register::current_context().index();
ExpectedSnippet<const char*> snippets[] = {
{"var a = 1; try { a = 2; } finally { a = 3; }",
4 * kPointerSize,
1,
- 47,
+ 50,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
+ B(Mov), R(context), R(3), //
B(LdaSmi8), U8(2), //
B(Star), R(0), //
B(LdaSmi8), U8(-1), //
@@ -4387,14 +4393,16 @@ TEST(TryFinally) {
0,
{},
1,
- {{4, 8, 14}}},
+ {{7, 11, 17}}},
{"var a = 1; try { a = 2; } catch(e) { a = 20 } finally { a = 3; }",
9 * kPointerSize,
1,
- 81,
+ 87,
{
B(LdaSmi8), U8(1), //
B(Star), R(0), //
+ B(Mov), R(context), R(4), //
+ B(Mov), R(context), R(5), //
B(LdaSmi8), U8(2), //
B(Star), R(0), //
B(Jump), U8(34), //
@@ -4437,14 +4445,17 @@ TEST(TryFinally) {
1,
{"e"},
2,
- {{4, 42, 48}, {4, 8, 10}}},
+ {{7, 48, 54}, {10, 14, 16}}},
{"var a; try {"
" try { a = 1 } catch(e) { a = 2 }"
"} catch(e) { a = 20 } finally { a = 3; }",
10 * kPointerSize,
1,
- 111,
+ 120,
{
+ B(Mov), R(context), R(4), //
+ B(Mov), R(context), R(5), //
+ B(Mov), R(context), R(6), //
B(LdaSmi8), U8(1), //
B(Star), R(0), //
B(Jump), U8(34), //
@@ -4502,7 +4513,7 @@ TEST(TryFinally) {
1,
{"e"},
3,
- {{0, 72, 78}, {0, 38, 40}, {0, 4, 6}}},
+ {{3, 81, 87}, {6, 47, 49}, {9, 13, 15}}},
};
for (size_t i = 0; i < arraysize(snippets); i++) {
« src/compiler/bytecode-graph-builder.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine