Changeset 197873 in webkit
- Timestamp:
- Mar 9, 2016, 12:36:40 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r197869 r197873 1 2016-03-09 Mark Lam <mark.lam@apple.com> 2 3 Add dumping of function expression names in CodeBlock bytecode dump. 4 https://bugs.webkit.org/show_bug.cgi?id=155248 5 6 Reviewed by Filip Pizlo. 7 8 Because ... 9 [ 19] new_func_exp loc5, loc3, f0:foo 10 11 ... is more informative than 12 [ 19] new_func_exp loc5, loc3, f0 13 14 Anonymous functions will be dumped as <anon>. 15 16 * bytecode/CodeBlock.cpp: 17 (JSC::CodeBlock::dumpFunctionExpr): 18 (JSC::CodeBlock::dumpBytecode): 19 * bytecode/CodeBlock.h: 20 1 21 2016-03-09 Michael Saboff <msaboff@apple.com> 2 22 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r197869 r197873 770 770 } 771 771 772 void CodeBlock::dumpFunctionExpr(PrintStream& out, int funcExprIndex) 773 { 774 out.printf("f%d", funcExprIndex); 775 if (!isCompilationThread()) { 776 FunctionExecutable* executable = functionExpr(funcExprIndex); 777 String name = executable->inferredName().string(); 778 if (name.isEmpty()) 779 out.print(":<anon>"); 780 else 781 out.print(":", name.utf8()); 782 } 783 } 784 772 785 void CodeBlock::dumpBytecode( 773 786 PrintStream& out, ExecState* exec, const Instruction* begin, const Instruction*& it, … … 1337 1350 int f0 = (++it)->u.operand; 1338 1351 printLocationAndOp(out, exec, location, it, "new_func"); 1339 out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); 1352 out.printf("%s, %s, ", registerName(r0).data(), registerName(r1).data()); 1353 dumpFunctionExpr(out, f0); 1340 1354 break; 1341 1355 } … … 1345 1359 int f0 = (++it)->u.operand; 1346 1360 printLocationAndOp(out, exec, location, it, "new_generator_func"); 1347 out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); 1361 out.printf("%s, %s, ", registerName(r0).data(), registerName(r1).data()); 1362 dumpFunctionExpr(out, f0); 1348 1363 break; 1349 1364 } … … 1353 1368 int f0 = (++it)->u.operand; 1354 1369 printLocationAndOp(out, exec, location, it, "op_new_arrow_func_exp"); 1355 out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); 1370 out.printf("%s, %s, ", registerName(r0).data(), registerName(r1).data()); 1371 dumpFunctionExpr(out, f0); 1356 1372 break; 1357 1373 } … … 1361 1377 int f0 = (++it)->u.operand; 1362 1378 printLocationAndOp(out, exec, location, it, "new_func_exp"); 1363 out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); 1379 out.printf("%s, %s, ", registerName(r0).data(), registerName(r1).data()); 1380 dumpFunctionExpr(out, f0); 1364 1381 break; 1365 1382 } … … 1369 1386 int f0 = (++it)->u.operand; 1370 1387 printLocationAndOp(out, exec, location, it, "new_generator_func_exp"); 1371 out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0); 1388 out.printf("%s, %s", registerName(r0).data(), registerName(r1).data()); 1389 dumpFunctionExpr(out, f0); 1372 1390 break; 1373 1391 } -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r197563 r197873 959 959 } 960 960 961 void dumpFunctionExpr(PrintStream&, int funcExprIndex); 961 962 void dumpBytecode( 962 963 PrintStream&, ExecState*, const Instruction* begin, const Instruction*&,
Note:
See TracChangeset
for help on using the changeset viewer.