Commit 24b1c1ab authored by neis's avatar neis Committed by Commit bot

[modules] Add namespace import snippet to test-bytecode-generator.

R=rmcilroy@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2460403002
Cr-Commit-Position: refs/heads/master@{#40694}
parent 2bac8f8c
...@@ -878,3 +878,85 @@ constant pool: [ ...@@ -878,3 +878,85 @@ constant pool: [
handlers: [ handlers: [
] ]
---
snippet: "
import * as foo from \"bar\"
foo.f(foo, foo.x);
"
frame size: 8
parameter count: 2
bytecode array length: 159
bytecodes: [
B(Ldar), R(new_target),
B(JumpIfUndefined), U8(21),
B(ResumeGenerator), R(new_target),
B(Star), R(1),
B(LdaZero),
B(TestEqualStrict), R(1), U8(0),
B(JumpIfTrue), U8(73),
B(LdaSmi), U8(76),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kAbort), R(2), U8(1),
B(LdaSmi), U8(-2),
B(Star), R(1),
B(LdaConstant), U8(0),
B(Star), R(4),
B(Mov), R(arg0), R(2),
B(Mov), R(closure), R(3),
B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(3),
B(PushContext), R(0),
B(Ldar), R(this),
B(StaCurrentContextSlot), U8(4),
B(LdaZero),
B(Star), R(2),
B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(2), U8(1),
B(StaCurrentContextSlot), U8(6),
/* 0 E> */ B(StackCheck),
/* 0 E> */ B(LdrCurrentContextSlot), U8(4), R(3),
B(Ldar), R(3),
B(Mov), R(closure), R(2),
B(CallRuntime), U16(Runtime::kCreateJSGeneratorObject), R(2), U8(2),
B(StaCurrentContextSlot), U8(5),
B(Star), R(2),
B(LdrCurrentContextSlot), U8(5), R(3),
B(LdaZero),
B(SuspendGenerator), R(3),
B(Ldar), R(2),
/* 45 S> */ B(Return),
B(LdaSmi), U8(-2),
B(Star), R(1),
B(CallRuntime), U16(Runtime::k_GeneratorGetInputOrDebugPos), R(3), U8(1),
B(Star), R(4),
B(CallRuntime), U16(Runtime::k_GeneratorGetResumeMode), R(3), U8(1),
B(Star), R(5),
B(LdaZero),
B(TestEqualStrict), R(5), U8(0),
B(JumpIfTrue), U8(26),
B(LdaSmi), U8(2),
B(TestEqualStrict), R(5), U8(0),
B(JumpIfTrue), U8(16),
B(Jump), U8(2),
B(LdaTrue),
B(Star), R(7),
B(Mov), R(4), R(6),
B(CallRuntime), U16(Runtime::k_CreateIterResultObject), R(6), U8(2),
/* 45 S> */ B(Return),
B(Ldar), R(4),
/* 0 E> */ B(Throw),
/* 27 S> */ B(LdrCurrentContextSlot), U8(6), R(3),
/* 30 E> */ B(LdrNamedProperty), R(3), U8(1), U8(4), R(2),
/* 33 E> */ B(LdrCurrentContextSlot), U8(6), R(4),
/* 38 E> */ B(LdrCurrentContextSlot), U8(6), R(6),
/* 41 E> */ B(LdrNamedProperty), R(6), U8(2), U8(6), R(5),
/* 31 E> */ B(CallProperty), R(2), R(3), U8(3), U8(2),
B(LdaUndefined),
/* 45 S> */ B(Return),
]
constant pool: [
FIXED_ARRAY_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"],
ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
]
handlers: [
]
...@@ -2238,6 +2238,9 @@ TEST(Modules) { ...@@ -2238,6 +2238,9 @@ TEST(Modules) {
"export {foo as goo} from \"bar\"\n", "export {foo as goo} from \"bar\"\n",
"export * from \"bar\"\n", "export * from \"bar\"\n",
"import * as foo from \"bar\"\n"
"foo.f(foo, foo.x);\n",
}; };
CHECK(CompareTexts(BuildActual(printer, snippets), CHECK(CompareTexts(BuildActual(printer, snippets),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment