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

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: Disable tests. Created 4 years, 10 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/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 7a62265a79492cd2943762c0915b958edc21c13c..310c73cfc913754fd7e15e5c7e0d885c7be30a59 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -4260,13 +4260,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), //
@@ -4290,12 +4292,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), //
@@ -4311,6 +4314,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), //
@@ -4334,7 +4338,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++) {
@@ -4350,15 +4354,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), //
@@ -4386,14 +4392,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), //
@@ -4436,14 +4444,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), //
@@ -4501,7 +4512,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++) {

Powered by Google App Engine
This is Rietveld 408576698