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

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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Use an accessor instead of a data property Created 4 years, 1 month 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: 10
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(LdaConstant), U8(2), 35 B(LdaConstant), U8(2),
36 B(ToName), R(6), 36 B(ToName), R(6),
37 B(CreateClosure), U8(3), U8(2), 37 B(CreateClosure), U8(3), U8(2),
38 B(Star), R(7), 38 B(Star), R(7),
39 B(LdaSmi), U8(2), 39 B(LdaSmi), U8(2),
40 B(Star), R(8), 40 B(Star), R(8),
41 B(LdaZero), 41 B(LdaZero),
42 B(Star), R(9), 42 B(Star), R(9),
43 B(Mov), R(4), R(5), 43 B(Mov), R(4), R(5),
44 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5), 44 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5),
45 B(LdaConstant), U8(4),
46 B(Star), R(6),
47 B(Mov), R(3), R(5),
48 B(CallRuntime), U16(Runtime::kDefineClassNameProperty), R(5), U8 (2),
45 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), 49 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
46 B(Star), R(0), 50 B(Star), R(0),
47 B(Star), R(1), 51 B(Star), R(1),
48 B(Star), R(2), 52 B(Star), R(2),
49 B(LdaUndefined), 53 B(LdaUndefined),
50 /* 149 S> */ B(Return), 54 /* 149 S> */ B(Return),
51 ] 55 ]
52 constant pool: [ 56 constant pool: [
53 SHARED_FUNCTION_INFO_TYPE, 57 SHARED_FUNCTION_INFO_TYPE,
54 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 58 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
55 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"], 59 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
56 SHARED_FUNCTION_INFO_TYPE, 60 SHARED_FUNCTION_INFO_TYPE,
61 ONE_BYTE_INTERNALIZED_STRING_TYPE ["Person"],
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: 10
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),
88 B(LdaConstant), U8(2), 93 B(LdaConstant), U8(2),
89 B(ToName), R(6), 94 B(ToName), R(6),
90 B(CreateClosure), U8(3), U8(2), 95 B(CreateClosure), U8(3), U8(2),
91 B(Star), R(7), 96 B(Star), R(7),
92 B(LdaSmi), U8(2), 97 B(LdaSmi), U8(2),
93 B(Star), R(8), 98 B(Star), R(8),
94 B(LdaZero), 99 B(LdaZero),
95 B(Star), R(9), 100 B(Star), R(9),
96 B(Mov), R(4), R(5), 101 B(Mov), R(4), R(5),
97 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5), 102 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(5) , U8(5),
103 B(LdaConstant), U8(4),
104 B(Star), R(6),
105 B(Mov), R(3), R(5),
106 B(CallRuntime), U16(Runtime::kDefineClassNameProperty), R(5), U8 (2),
98 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1), 107 B(CallRuntime), U16(Runtime::kToFastProperties), R(3), U8(1),
99 B(Star), R(0), 108 B(Star), R(0),
100 B(Star), R(1), 109 B(Star), R(1),
101 B(Star), R(2), 110 B(Star), R(2),
102 B(LdaUndefined), 111 B(LdaUndefined),
103 /* 149 S> */ B(Return), 112 /* 149 S> */ B(Return),
104 ] 113 ]
105 constant pool: [ 114 constant pool: [
106 SHARED_FUNCTION_INFO_TYPE, 115 SHARED_FUNCTION_INFO_TYPE,
107 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 116 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
108 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"], 117 ONE_BYTE_INTERNALIZED_STRING_TYPE ["speak"],
109 SHARED_FUNCTION_INFO_TYPE, 118 SHARED_FUNCTION_INFO_TYPE,
119 ONE_BYTE_INTERNALIZED_STRING_TYPE ["person"],
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: 11
124 parameter count: 1 134 parameter count: 1
125 bytecode array length: 128 135 bytecode array length: 140
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),
(...skipping 25 matching lines...) Expand all
161 B(LdaConstant), U8(3), 171 B(LdaConstant), U8(3),
162 B(TestEqualStrict), R(7), U8(0), 172 B(TestEqualStrict), R(7), U8(0),
163 B(Mov), R(4), R(6), 173 B(Mov), R(4), R(6),
164 B(JumpIfToBooleanFalse), U8(7), 174 B(JumpIfToBooleanFalse), U8(7),
165 B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0), 175 B(CallRuntime), U16(Runtime::kThrowStaticPrototypeError), R(0), U8(0),
166 B(CreateClosure), U8(5), U8(2), 176 B(CreateClosure), U8(5), U8(2),
167 B(Star), R(8), 177 B(Star), R(8),
168 B(LdaSmi), U8(1), 178 B(LdaSmi), U8(1),
169 B(Star), R(10), 179 B(Star), R(10),
170 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5), 180 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5),
181 B(LdaConstant), U8(6),
182 B(Star), R(7),
183 B(Mov), R(4), R(6),
184 B(CallRuntime), U16(Runtime::kDefineClassNameProperty), R(6), U8 (2),
171 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), 185 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
172 B(Star), R(0), 186 B(Star), R(0),
173 B(Star), R(1), 187 B(Star), R(1),
174 B(Star), R(2), 188 B(Star), R(2),
175 B(LdaUndefined), 189 B(LdaUndefined),
176 /* 129 S> */ B(Return), 190 /* 129 S> */ B(Return),
177 ] 191 ]
178 constant pool: [ 192 constant pool: [
179 ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"], 193 ONE_BYTE_INTERNALIZED_STRING_TYPE ["a"],
180 ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"], 194 ONE_BYTE_INTERNALIZED_STRING_TYPE ["b"],
181 SHARED_FUNCTION_INFO_TYPE, 195 SHARED_FUNCTION_INFO_TYPE,
182 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 196 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
183 SHARED_FUNCTION_INFO_TYPE, 197 SHARED_FUNCTION_INFO_TYPE,
184 SHARED_FUNCTION_INFO_TYPE, 198 SHARED_FUNCTION_INFO_TYPE,
199 ONE_BYTE_INTERNALIZED_STRING_TYPE ["N"],
185 ] 200 ]
186 handlers: [ 201 handlers: [
187 ] 202 ]
188 203
189 --- 204 ---
190 snippet: " 205 snippet: "
191 var count = 0; 206 var count = 0;
192 class C { constructor() { count++; }} 207 class C { constructor() { count++; }}
193 return new C(); 208 return new C();
194 " 209 "
195 frame size: 8 210 frame size: 8
196 parameter count: 1 211 parameter count: 1
197 bytecode array length: 74 212 bytecode array length: 86
198 bytecodes: [ 213 bytecodes: [
199 B(CreateFunctionContext), U8(1), 214 B(CreateFunctionContext), U8(1),
200 B(PushContext), R(3), 215 B(PushContext), R(3),
201 B(LdaTheHole), 216 B(LdaTheHole),
202 B(Star), R(2), 217 B(Star), R(2),
203 /* 30 E> */ B(StackCheck), 218 /* 30 E> */ B(StackCheck),
204 /* 46 S> */ B(LdaZero), 219 /* 46 S> */ B(LdaZero),
205 /* 46 E> */ B(StaContextSlot), R(context), U8(4), U8(0), 220 /* 46 E> */ B(StaContextSlot), R(context), U8(4), U8(0),
206 B(LdaTheHole), 221 B(LdaTheHole),
207 B(Star), R(0), 222 B(Star), R(0),
208 /* 49 S> */ B(LdaTheHole), 223 /* 49 S> */ B(LdaTheHole),
209 B(Star), R(4), 224 B(Star), R(4),
210 B(CreateClosure), U8(0), U8(2), 225 B(CreateClosure), U8(0), U8(2),
211 B(Star), R(5), 226 B(Star), R(5),
212 B(LdaSmi), U8(49), 227 B(LdaSmi), U8(49),
213 B(Star), R(6), 228 B(Star), R(6),
214 B(LdaSmi), U8(86), 229 B(LdaSmi), U8(86),
215 B(Star), R(7), 230 B(Star), R(7),
216 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4), 231 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
217 B(Star), R(4), 232 B(Star), R(4),
218 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5), 233 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5),
234 B(LdaConstant), U8(2),
235 B(Star), R(7),
236 B(Mov), R(4), R(6),
237 B(CallRuntime), U16(Runtime::kDefineClassNameProperty), R(6), U8 (2),
219 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), 238 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
220 B(Star), R(0), 239 B(Star), R(0),
221 B(Star), R(1), 240 B(Star), R(1),
222 B(Star), R(2), 241 B(Star), R(2),
223 /* 87 S> */ B(JumpIfNotHole), U8(11), 242 /* 87 S> */ B(JumpIfNotHole), U8(11),
224 B(LdaConstant), U8(2), 243 B(LdaConstant), U8(2),
225 B(Star), R(4), 244 B(Star), R(4),
226 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1), 245 B(CallRuntime), U16(Runtime::kThrowReferenceError), R(4), U8(1),
227 B(Star), R(4), 246 B(Star), R(4),
228 /* 94 E> */ B(New), R(4), R(0), U8(0), U8(4), 247 /* 94 E> */ B(New), R(4), R(0), U8(0), U8(4),
229 /* 103 S> */ B(Return), 248 /* 103 S> */ B(Return),
230 ] 249 ]
231 constant pool: [ 250 constant pool: [
232 SHARED_FUNCTION_INFO_TYPE, 251 SHARED_FUNCTION_INFO_TYPE,
233 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"], 252 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
234 ONE_BYTE_INTERNALIZED_STRING_TYPE ["C"], 253 ONE_BYTE_INTERNALIZED_STRING_TYPE ["C"],
235 ] 254 ]
236 handlers: [ 255 handlers: [
237 ] 256 ]
238 257
258 ---
259 snippet: "
260 (class {})
261 class E { static name () {}}
262 "
263 frame size: 11
264 parameter count: 1
265 bytecode array length: 116
266 bytecodes: [
267 B(LdaTheHole),
268 B(Star), R(3),
269 /* 30 E> */ B(StackCheck),
270 /* 35 S> */ B(LdaTheHole),
271 B(Star), R(4),
272 B(CreateClosure), U8(0), U8(2),
273 B(Star), R(5),
274 B(LdaSmi), U8(35),
275 B(Star), R(6),
276 B(LdaSmi), U8(43),
277 B(Star), R(7),
278 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
279 B(Star), R(4),
280 B(LdrNamedProperty), R(4), U8(1), U8(2), R(5),
281 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
282 B(Star), R(1),
283 B(LdaTheHole),
284 B(Star), R(0),
285 /* 45 S> */ B(LdaTheHole),
286 B(Star), R(4),
287 B(CreateClosure), U8(2), U8(2),
288 B(Star), R(5),
289 B(LdaSmi), U8(45),
290 B(Star), R(6),
291 B(LdaSmi), U8(73),
292 B(Star), R(7),
293 B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(4),
294 B(Star), R(4),
295 B(LdrNamedProperty), R(4), U8(1), U8(4), R(5),
296 B(LdaConstant), U8(3),
297 B(ToName), R(7),
298 B(CreateClosure), U8(4), U8(2),
299 B(Star), R(8),
300 B(LdaSmi), U8(2),
301 B(Star), R(9),
302 B(LdaZero),
303 B(Star), R(10),
304 B(Mov), R(4), R(6),
305 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(6) , U8(5),
306 B(LdaConstant), U8(5),
307 B(Star), R(7),
308 B(CallRuntime), U16(Runtime::kDefineClassNameProperty), R(6), U8 (2),
309 B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1),
310 B(Star), R(0),
311 B(Star), R(2),
312 B(Star), R(3),
313 B(LdaUndefined),
314 /* 74 S> */ B(Return),
315 ]
316 constant pool: [
317 SHARED_FUNCTION_INFO_TYPE,
318 ONE_BYTE_INTERNALIZED_STRING_TYPE ["prototype"],
319 SHARED_FUNCTION_INFO_TYPE,
320 ONE_BYTE_INTERNALIZED_STRING_TYPE ["name"],
321 SHARED_FUNCTION_INFO_TYPE,
322 ONE_BYTE_INTERNALIZED_STRING_TYPE ["E"],
323 ]
324 handlers: [
325 ]
326
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698