Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (134380 => 134381)
--- trunk/Source/_javascript_Core/ChangeLog 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-11-13 08:42:47 UTC (rev 134381)
@@ -1,5 +1,29 @@
2012-11-12 Filip Pizlo <[email protected]>
+ op_get_callee should have value profiling
+ https://bugs.webkit.org/show_bug.cgi?id=102047
+
+ Reviewed by Sam Weinig.
+
+ This will allow us to detect if the callee is always the same, which is probably
+ the common case for a lot of constructors.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::CodeBlock):
+ * bytecode/Opcode.h:
+ (JSC):
+ (JSC::padOpcodeName):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_get_callee):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_get_callee):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2012-11-12 Filip Pizlo <[email protected]>
+
The act of getting the callee during 'this' construction should be explicit in bytecode
https://bugs.webkit.org/show_bug.cgi?id=102016
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (134380 => 134381)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2012-11-13 08:42:47 UTC (rev 134381)
@@ -1796,7 +1796,8 @@
case op_resolve_with_base:
case op_resolve_with_this:
case op_get_by_id:
- case op_call_put_result: {
+ case op_call_put_result:
+ case op_get_callee: {
ValueProfile* profile = "" + opLength - 1].u.operand];
ASSERT(profile->m_bytecodeOffset == -1);
profile->m_bytecodeOffset = i;
Modified: trunk/Source/_javascript_Core/bytecode/Opcode.h (134380 => 134381)
--- trunk/Source/_javascript_Core/bytecode/Opcode.h 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/bytecode/Opcode.h 2012-11-13 08:42:47 UTC (rev 134381)
@@ -45,7 +45,7 @@
macro(op_init_lazy_reg, 2) \
macro(op_create_arguments, 2) \
macro(op_create_this, 3) \
- macro(op_get_callee, 2) \
+ macro(op_get_callee, 3) \
macro(op_convert_this, 3) \
\
macro(op_new_object, 2) \
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (134380 => 134381)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2012-11-13 08:42:47 UTC (rev 134381)
@@ -460,8 +460,9 @@
RefPtr<RegisterID> func = newTemporary();
- emitOpcode(op_get_callee);
+ UnlinkedValueProfile profile = ""
instructions().append(func->index());
+ instructions().append(profile);
emitOpcode(op_create_this);
instructions().append(m_thisRegister.index());
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (134380 => 134381)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2012-11-13 08:42:47 UTC (rev 134381)
@@ -1214,6 +1214,7 @@
{
unsigned result = currentInstruction[1].u.operand;
emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
+ emitValueProfilingSite();
emitPutVirtualRegister(result);
}
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (134380 => 134381)
--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2012-11-13 08:42:47 UTC (rev 134381)
@@ -1471,7 +1471,9 @@
{
int dst = currentInstruction[1].u.operand;
emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
- emitStoreCell(dst, regT0);
+ move(TrustedImm32(JSValue::CellTag), regT1);
+ emitValueProfilingSite();
+ emitStore(dst, regT1, regT0);
}
void JIT::emit_op_create_this(Instruction* currentInstruction)
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (134380 => 134381)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2012-11-13 08:42:47 UTC (rev 134381)
@@ -368,9 +368,11 @@
traceExecution()
loadi 4[PC], t0
loadp PayloadOffset + Callee[cfr], t1
+ loadp 8[PC], t2
+ valueProfile(CellTag, t1, t2)
storei CellTag, TagOffset[cfr, t0, 8]
storei t1, PayloadOffset[cfr, t0, 8]
- dispatch(2)
+ dispatch(3)
_llint_op_convert_this:
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (134380 => 134381)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2012-11-13 08:39:00 UTC (rev 134380)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2012-11-13 08:42:47 UTC (rev 134381)
@@ -257,10 +257,12 @@
_llint_op_get_callee:
traceExecution()
- loadis 8[PB, PC, 8], t0
+ loadisFromInstruction(1, t0)
+ loadpFromInstruction(2, t2)
loadp Callee[cfr], t1
+ valueProfile(t1, t2)
storep t1, [cfr, t0, 8]
- dispatch(2)
+ dispatch(3)
_llint_op_convert_this: