DeclareGlobals.golden 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: no
top level: yes

---
snippet: "
  var a = 1;
"
13
frame size: 3
14
parameter count: 1
15
bytecode array length: 18
16
bytecodes: [
17
                B(LdaConstant), U8(0),
18
                B(Star1),
19
                B(Mov), R(closure), R(2),
20
  /*    0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
21
  /*    8 S> */ B(LdaSmi), I8(1),
22
  /*    8 E> */ B(StaGlobal), U8(1), U8(0),
23
                B(LdaUndefined),
24
  /*   11 S> */ B(Return),
25 26
]
constant pool: [
27 28
  FIXED_ARRAY_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
29 30 31 32 33 34 35 36
]
handlers: [
]

---
snippet: "
  function f() {}
"
37
frame size: 2
38
parameter count: 1
39
bytecode array length: 13
40
bytecodes: [
41
                B(LdaConstant), U8(0),
42
                B(Star0),
43
                B(Mov), R(closure), R(1),
44
  /*    0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(0), U8(2),
45
                B(LdaUndefined),
46
  /*   16 S> */ B(Return),
47 48
]
constant pool: [
49
  FIXED_ARRAY_TYPE,
50 51 52 53 54 55 56 57 58
]
handlers: [
]

---
snippet: "
  var a = 1;
  a=2;
"
59
frame size: 3
60
parameter count: 1
61
bytecode array length: 28
62
bytecodes: [
63
                B(LdaConstant), U8(0),
64
                B(Star1),
65
                B(Mov), R(closure), R(2),
66
  /*    0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
67
  /*    8 S> */ B(LdaSmi), I8(1),
68
  /*    8 E> */ B(StaGlobal), U8(1), U8(0),
69
  /*   11 S> */ B(LdaSmi), I8(2),
70
                B(Star1),
71
  /*   12 E> */ B(StaGlobal), U8(1), U8(0),
72 73
                B(Mov), R(1), R(0),
                B(Ldar), R(0),
74
  /*   16 S> */ B(Return),
75 76
]
constant pool: [
77 78
  FIXED_ARRAY_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
79 80 81 82 83 84 85 86 87
]
handlers: [
]

---
snippet: "
  function f() {}
  f();
"
88
frame size: 3
89
parameter count: 1
90
bytecode array length: 20
91
bytecodes: [
92
                B(LdaConstant), U8(0),
93
                B(Star1),
94
                B(Mov), R(closure), R(2),
95
  /*    0 E> */ B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2),
96
  /*   16 S> */ B(LdaGlobal), U8(1), U8(0),
97
                B(Star1),
98
  /*   16 E> */ B(CallUndefinedReceiver0), R(1), U8(2),
99
                B(Star0),
100
  /*   21 S> */ B(Return),
101 102
]
constant pool: [
103
  FIXED_ARRAY_TYPE,
104
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"],
105 106 107 108
]
handlers: [
]