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

Side by Side Diff: test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Check for 'name' properties at parse-time Created 4 years 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 unified diff | Download patch
OLDNEW
1 # 1 #
2 # Autogenerated by generate-bytecode-expectations. 2 # Autogenerated by generate-bytecode-expectations.
3 # 3 #
4 4
5 --- 5 ---
6 wrap: yes 6 wrap: yes
7 7
8 --- 8 ---
9 snippet: " 9 snippet: "
10 class Person { 10 class Person {
11 constructor(name) { this.name = name; } 11 constructor(name) { this.name = name; }
12 speak() { console.log(this.name + ' is speaking.'); } 12 speak() { console.log(this.name + ' is speaking.'); }
13 } 13 }
14 " 14 "
15 frame size: 10 15 frame size: 11
16 parameter count: 1 16 parameter count: 1
17 bytecode array length: 74 17 bytecode array length: 86
18 bytecodes: [ 18 bytecodes: [
19 B(LdaTheHole), 19 B(LdaTheHole),
20 B(Star), R(2), 20 B(Star), R(2),
21 /* 30 E> */ B(StackCheck), 21 /* 30 E> */ B(StackCheck),
22 B(LdaTheHole), 22 B(LdaTheHole),
23 B(Star), R(0), 23 B(Star), R(0),
24 /* 34 S> */ B(LdaTheHole), 24 /* 34 S> */ B(LdaTheHole),
25 B(Star), R(3), 25 B(Star), R(3),
26 B(CreateClosure), U8(0), U8(2), 26 B(CreateClosure), U8(0), U8(2),
27 B(Star), R(4), 27 B(Star), R(4),
28 B(LdaSmi), U8(34), 28 B(LdaSmi), U8(34),
29 B(Star), R(5), 29 B(Star), R(5),
30 B(Wide), B(LdaSmi), U16(148), 30 B(Wide), B(LdaSmi), U16(148),
31 B(Star), R(6), 31 B(Star), R(6),
32 B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), 32 B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
33 B(Star), R(3), 33 B(Star), R(3),
34 B(LdrNamedProperty), R(3), U8(1), U8(2), R(4), 34 B(LdrNamedProperty), R(3), U8(1), U8(2), R(4),
35 B(LdaTrue),
36 B(Star), R(5),
35 B(LdaConstant), U8(2), 37 B(LdaConstant), U8(2),
36 B(ToName), R(6), 38 B(ToName), R(7),
37 B(CreateClosure), U8(3), U8(2), 39 B(CreateClosure), U8(3), U8(2),
38 B(Star), R(7), 40 B(Star), R(8),
39 B(LdaSmi), U8(2), 41 B(LdaSmi), U8(2),
40 B(Star), R(8), 42 B(Star), R(9),
41 B(LdaZero), 43 B(LdaZero),
42 B(Star), R(9), 44 B(Star), R(10),
43 B(Mov), R(4), R(5), 45 B(Mov), R(4), R(6),
44 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5), 46 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5),
47 B(Ldar), R(5),
48 B(JumpIfToBooleanFalse), U8(7),
49 B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U 8(1),
45 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), 50 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
46 B(Star), R(0), 51 B(Star), R(0),
47 B(Star), R(1), 52 B(Star), R(1),
48 B(Star), R(2), 53 B(Star), R(2),
49 B(LdaUndefined), 54 B(LdaUndefined),
50 /* 149 S> */ B(Return), 55 /* 149 S> */ B(Return),
51 ] 56 ]
52 constant pool: [ 57 constant pool: [
53 SHARED_FUNCTION_INFO_TYPE, 58 SHARED_FUNCTION_INFO_TYPE,
54 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 59 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
55 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"], 60 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
56 SHARED_FUNCTION_INFO_TYPE, 61 SHARED_FUNCTION_INFO_TYPE,
57 ] 62 ]
58 handlers: [ 63 handlers: [
59 ] 64 ]
60 65
61 --- 66 ---
62 snippet: " 67 snippet: "
63 class person { 68 class person {
64 constructor(name) { this.name = name; } 69 constructor(name) { this.name = name; }
65 speak() { console.log(this.name + ' is speaking.'); } 70 speak() { console.log(this.name + ' is speaking.'); }
66 } 71 }
67 " 72 "
68 frame size: 10 73 frame size: 11
69 parameter count: 1 74 parameter count: 1
70 bytecode array length: 74 75 bytecode array length: 86
71 bytecodes: [ 76 bytecodes: [
72 B(LdaTheHole), 77 B(LdaTheHole),
73 B(Star), R(2), 78 B(Star), R(2),
74 /* 30 E> */ B(StackCheck), 79 /* 30 E> */ B(StackCheck),
75 B(LdaTheHole), 80 B(LdaTheHole),
76 B(Star), R(0), 81 B(Star), R(0),
77 /* 34 S> */ B(LdaTheHole), 82 /* 34 S> */ B(LdaTheHole),
78 B(Star), R(3), 83 B(Star), R(3),
79 B(CreateClosure), U8(0), U8(2), 84 B(CreateClosure), U8(0), U8(2),
80 B(Star), R(4), 85 B(Star), R(4),
81 B(LdaSmi), U8(34), 86 B(LdaSmi), U8(34),
82 B(Star), R(5), 87 B(Star), R(5),
83 B(Wide), B(LdaSmi), U16(148), 88 B(Wide), B(LdaSmi), U16(148),
84 B(Star), R(6), 89 B(Star), R(6),
85 B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4), 90 B(CallRuntime), U16(Runtime::kDefineClass), R(3), U8(4),
86 B(Star), R(3), 91 B(Star), R(3),
87 B(LdrNamedProperty), R(3), U8(1), U8(2), R(4), 92 B(LdrNamedProperty), R(3), U8(1), U8(2), R(4),
93 B(LdaTrue),
94 B(Star), R(5),
88 B(LdaConstant), U8(2), 95 B(LdaConstant), U8(2),
89 B(ToName), R(6), 96 B(ToName), R(7),
90 B(CreateClosure), U8(3), U8(2), 97 B(CreateClosure), U8(3), U8(2),
91 B(Star), R(7), 98 B(Star), R(8),
92 B(LdaSmi), U8(2), 99 B(LdaSmi), U8(2),
93 B(Star), R(8), 100 B(Star), R(9),
94 B(LdaZero), 101 B(LdaZero),
95 B(Star), R(9), 102 B(Star), R(10),
96 B(Mov), R(4), R(5), 103 B(Mov), R(4), R(6),
97 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5), 104 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5),
105 B(Ldar), R(5),
106 B(JumpIfToBooleanFalse), U8(7),
107 B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(3), U 8(1),
98 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), 108 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
99 B(Star), R(0), 109 B(Star), R(0),
100 B(Star), R(1), 110 B(Star), R(1),
101 B(Star), R(2), 111 B(Star), R(2),
102 B(LdaUndefined), 112 B(LdaUndefined),
103 /* 149 S> */ B(Return), 113 /* 149 S> */ B(Return),
104 ] 114 ]
105 constant pool: [ 115 constant pool: [
106 SHARED_FUNCTION_INFO_TYPE, 116 SHARED_FUNCTION_INFO_TYPE,
107 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 117 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
108 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"], 118 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
109 SHARED_FUNCTION_INFO_TYPE, 119 SHARED_FUNCTION_INFO_TYPE,
110 ] 120 ]
111 handlers: [ 121 handlers: [
112 ] 122 ]
113 123
114 --- 124 ---
115 snippet: " 125 snippet: "
116 var n0 = 'a'; 126 var n0 = 'a';
117 var n1 = 'b'; 127 var n1 = 'b';
118 class N { 128 class N {
119 [n0]() { return n0; } 129 [n0]() { return n0; }
120 static [n1]() { return n1; } 130 static [n1]() { return n1; }
121 } 131 }
122 " 132 "
123 frame size: 11 133 frame size: 12
124 parameter count: 1 134 parameter count: 1
125 bytecode array length: 128 135 bytecode array length: 152
126 bytecodes: [ 136 bytecodes: [
127 B(CreateFunctionContext), U8(2), 137 B(CreateFunctionContext), U8(2),
128 B(PushContext), R(3), 138 B(PushContext), R(3),
129 B(LdaTheHole), 139 B(LdaTheHole),
130 B(Star), R(2), 140 B(Star), R(2),
131 /* 30 E> */ B(StackCheck), 141 /* 30 E> */ B(StackCheck),
132 /* 43 S> */ B(LdaConstant), U8(0), 142 /* 43 S> */ B(LdaConstant), U8(0),
133 /* 43 E> */ B(StaContextSlot), R(context), U8(4), U8(0), 143 /* 43 E> */ B(StaContextSlot), R(context), U8(4), U8(0),
134 /* 57 S> */ B(LdaConstant), U8(1), 144 /* 57 S> */ B(LdaConstant), U8(1),
135 /* 57 E> */ B(StaContextSlot), R(context), U8(5), U8(0), 145 /* 57 E> */ B(StaContextSlot), R(context), U8(5), U8(0),
136 B(LdaTheHole), 146 B(LdaTheHole),
137 B(Star), R(0), 147 B(Star), R(0),
138 /* 62 S> */ B(LdaTheHole), 148 /* 62 S> */ B(LdaTheHole),
139 B(Star), R(4), 149 B(Star), R(4),
140 B(CreateClosure), U8(2), U8(2), 150 B(CreateClosure), U8(2), U8(2),
141 B(Star), R(5), 151 B(Star), R(5),
142 B(LdaSmi), U8(62), 152 B(LdaSmi), U8(62),
143 B(Star), R(6), 153 B(Star), R(6),
144 B(Wide), B(LdaSmi), U16(128), 154 B(Wide), B(LdaSmi), U16(128),
145 B(Star), R(7), 155 B(Star), R(7),
146 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), 156 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
147 B(Star), R(4), 157 B(Star), R(4),
148 B(LdrNamedProperty), R(4), U8(3), U8(2), R(5), 158 B(LdrNamedProperty), R(4), U8(3), U8(2), R(5),
159 B(LdaTrue),
160 B(Star), R(6),
149 /* 75 E> */ B(LdaContextSlot), R(context), U8(4), U8(0), 161 /* 75 E> */ B(LdaContextSlot), R(context), U8(4), U8(0),
150 B(ToName), R(7), 162 B(ToName), R(8),
151 B(CreateClosure), U8(4), U8(2), 163 B(CreateClosure), U8(4), U8(2),
152 B(Star), R(8), 164 B(Star), R(9),
153 B(LdaSmi), U8(2), 165 B(LdaSmi), U8(2),
166 B(Star), R(10),
167 B(LdaSmi), U8(1),
168 B(Star), R(11),
169 B(Mov), R(5), R(7),
170 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7) , U8(5),
171 /* 106 E> */ B(LdaContextSlot), R(context), U8(5), U8(0),
172 B(ToName), R(8),
173 B(Mov), R(4), R(7),
174 B(Ldar), R(6),
175 B(JumpIfToBooleanFalse), U8(10),
176 B(LdaConstant), U8(5),
177 B(TestEqualStrict), R(8), U8(0),
178 B(LogicalNot),
179 B(Star), R(6),
180 B(LdaConstant), U8(3),
181 B(TestEqualStrict), R(8), U8(0),
182 B(JumpIfFalse), U8(7),
183 B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
184 B(CreateClosure), U8(6), U8(2),
154 B(Star), R(9), 185 B(Star), R(9),
155 B(LdaSmi), U8(1), 186 B(LdaSmi), U8(1),
156 B(Star), R(10), 187 B(Star), R(11),
157 B(Mov), R(5), R(6), 188 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7) , U8(5),
158 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5), 189 B(Ldar), R(6),
159 /* 106 E> */ B(LdaContextSlot), R(context), U8(5), U8(0),
160 B(ToName), R(7),
161 B(LdaConstant), U8(3),
162 B(TestEqualStrict), R(7), U8(0),
163 B(Mov), R(4), R(6),
164 B(JumpIfToBooleanFalse), U8(7), 190 B(JumpIfToBooleanFalse), U8(7),
165 B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), 191 B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(4), U 8(1),
166 B(CreateClosure), U8(5), U8(2),
167 B(Star), R(8),
168 B(LdaSmi), U8(1),
169 B(Star), R(10),
170 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5),
171 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), 192 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
172 B(Star), R(0), 193 B(Star), R(0),
173 B(Star), R(1), 194 B(Star), R(1),
174 B(Star), R(2), 195 B(Star), R(2),
175 B(LdaUndefined), 196 B(LdaUndefined),
176 /* 129 S> */ B(Return), 197 /* 129 S> */ B(Return),
177 ] 198 ]
178 constant pool: [ 199 constant pool: [
179 ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"], 200 ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
180 ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"], 201 ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
181 SHARED_FUNCTION_INFO_TYPE, 202 SHARED_FUNCTION_INFO_TYPE,
182 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 203 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
183 SHARED_FUNCTION_INFO_TYPE, 204 SHARED_FUNCTION_INFO_TYPE,
205 ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"],
184 SHARED_FUNCTION_INFO_TYPE, 206 SHARED_FUNCTION_INFO_TYPE,
185 ] 207 ]
186 handlers: [ 208 handlers: [
187 ] 209 ]
188 210
189 --- 211 ---
190 snippet: " 212 snippet: "
191 var count = 0; 213 var count = 0;
192 class C { constructor() { count++; }} 214 class C { constructor() { count++; }}
193 return new C(); 215 return new C();
194 " 216 "
195 frame size: 8 217 frame size: 8
196 parameter count: 1 218 parameter count: 1
197 bytecode array length: 74 219 bytecode array length: 84
198 bytecodes: [ 220 bytecodes: [
199 B(CreateFunctionContext), U8(1), 221 B(CreateFunctionContext), U8(1),
200 B(PushContext), R(3), 222 B(PushContext), R(3),
201 B(LdaTheHole), 223 B(LdaTheHole),
202 B(Star), R(2), 224 B(Star), R(2),
203 /* 30 E> */ B(StackCheck), 225 /* 30 E> */ B(StackCheck),
204 /* 46 S> */ B(LdaZero), 226 /* 46 S> */ B(LdaZero),
205 /* 46 E> */ B(StaContextSlot), R(context), U8(4), U8(0), 227 /* 46 E> */ B(StaContextSlot), R(context), U8(4), U8(0),
206 B(LdaTheHole), 228 B(LdaTheHole),
207 B(Star), R(0), 229 B(Star), R(0),
208 /* 49 S> */ B(LdaTheHole), 230 /* 49 S> */ B(LdaTheHole),
209 B(Star), R(4), 231 B(Star), R(4),
210 B(CreateClosure), U8(0), U8(2), 232 B(CreateClosure), U8(0), U8(2),
211 B(Star), R(5), 233 B(Star), R(5),
212 B(LdaSmi), U8(49), 234 B(LdaSmi), U8(49),
213 B(Star), R(6), 235 B(Star), R(6),
214 B(LdaSmi), U8(86), 236 B(LdaSmi), U8(86),
215 B(Star), R(7), 237 B(Star), R(7),
216 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), 238 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
217 B(Star), R(4), 239 B(Star), R(4),
218 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5), 240 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5),
241 B(LdaTrue),
242 B(Star), R(6),
243 B(JumpIfToBooleanFalse), U8(7),
244 B(CallRuntime), U16(Runtime::kInstallClassNameAccessor), R(4), U 8(1),
219 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), 245 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
220 B(Star), R(0), 246 B(Star), R(0),
221 B(Star), R(1), 247 B(Star), R(1),
222 B(Star), R(2), 248 B(Star), R(2),
223 /* 87 S> */ B(JumpIfNotHole), U8(11), 249 /* 87 S> */ B(JumpIfNotHole), U8(11),
224 B(LdaConstant), U8(2), 250 B(LdaConstant), U8(2),
225 B(Star), R(4), 251 B(Star), R(4),
226 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1), 252 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
227 B(Star), R(4), 253 B(Star), R(4),
228 /* 94 E> */ B(New), R(4), R(0), U8(0), U8(4), 254 /* 94 E> */ B(New), R(4), R(0), U8(0), U8(4),
229 /* 103 S> */ B(Return), 255 /* 103 S> */ B(Return),
230 ] 256 ]
231 constant pool: [ 257 constant pool: [
232 SHARED_FUNCTION_INFO_TYPE, 258 SHARED_FUNCTION_INFO_TYPE,
233 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 259 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
234 ONE_BYTE_INTERNALIZED_STRING_TYPE ["C"], 260 ONE_BYTE_INTERNALIZED_STRING_TYPE ["C"],
235 ] 261 ]
236 handlers: [ 262 handlers: [
237 ] 263 ]
238 264
265 ---
266 snippet: "
267 (class {})
268 class E { static name () {}}
269 "
270 frame size: 12
271 parameter count: 1
272 bytecode array length: 107
273 bytecodes: [
274 B(LdaTheHole),
275 B(Star), R(3),
276 /* 30 E> */ B(StackCheck),
277 /* 35 S> */ B(LdaTheHole),
278 B(Star), R(4),
279 B(CreateClosure), U8(0), U8(2),
280 B(Star), R(5),
281 B(LdaSmi), U8(35),
282 B(Star), R(6),
283 B(LdaSmi), U8(43),
284 B(Star), R(7),
285 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
286 B(Star), R(4),
287 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5),
288 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
289 B(Star), R(1),
290 B(LdaTheHole),
291 B(Star), R(0),
292 /* 45 S> */ B(LdaTheHole),
293 B(Star), R(4),
294 B(CreateClosure), U8(2), U8(2),
295 B(Star), R(5),
296 B(LdaSmi), U8(45),
297 B(Star), R(6),
298 B(LdaSmi), U8(73),
299 B(Star), R(7),
300 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
301 B(Star), R(4),
302 B(LdrNamedProperty), R(4), U8(1), U8(4), R(5),
303 B(LdaConstant), U8(3),
304 B(ToName), R(8),
305 B(CreateClosure), U8(4), U8(2),
306 B(Star), R(9),
307 B(LdaSmi), U8(2),
308 B(Star), R(10),
309 B(LdaZero),
310 B(Star), R(11),
311 B(Mov), R(4), R(7),
312 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(7) , U8(5),
313 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
314 B(Star), R(0),
315 B(Star), R(2),
316 B(Star), R(3),
317 B(LdaUndefined),
318 /* 74 S> */ B(Return),
319 ]
320 constant pool: [
321 SHARED_FUNCTION_INFO_TYPE,
322 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
323 SHARED_FUNCTION_INFO_TYPE,
324 ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"],
325 SHARED_FUNCTION_INFO_TYPE,
326 ]
327 handlers: [
328 ]
329
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698