Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (172593 => 172594)
--- trunk/Source/_javascript_Core/ChangeLog 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/ChangeLog 2014-08-14 18:07:00 UTC (rev 172594)
@@ -1,3 +1,66 @@
+2014-08-14 Oliver Hunt <oli...@apple.com>
+
+ Create activations eagerly
+ https://bugs.webkit.org/show_bug.cgi?id=135942
+
+ Reviewed by Geoffrey Garen.
+
+ Prepare to rewrite activation objects into a more
+ sane implementation. Step 1 is reverting to eager
+ creation of the activation object. This results in
+ a 1.35x regression in earley, but otherwise has a
+ minimal performance impact.
+
+ The earley regression is being tracked by bug #135943
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitNewFunctionInternal):
+ (JSC::BytecodeGenerator::emitNewFunctionExpression):
+ (JSC::BytecodeGenerator::emitCallEval):
+ (JSC::BytecodeGenerator::emitPushWithScope):
+ (JSC::BytecodeGenerator::emitPushCatchScope):
+ (JSC::BytecodeGenerator::createActivationIfNecessary): Deleted.
+ * bytecompiler/BytecodeGenerator.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_create_activation):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_create_activation):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
+2014-08-14 Oliver Hunt <oli...@apple.com>
+
+ Create activations eagerly
+ https://bugs.webkit.org/show_bug.cgi?id=135942
+
+ Reviewed by Geoffrey Garen.
+
+ Prepare to rewrite activation objects into a more
+ sane implementation. Step 1 is reverting to eager
+ creation of the activation object. This results in
+ a 1.35x regression in earley, but otherwise has a
+ minimal performance impact.
+
+ The earley regression is being tracked by
+ http://webkit.org/b/135943
+
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitNewFunctionInternal):
+ (JSC::BytecodeGenerator::emitNewFunctionExpression):
+ (JSC::BytecodeGenerator::emitCallEval):
+ (JSC::BytecodeGenerator::emitPushWithScope):
+ (JSC::BytecodeGenerator::emitPushCatchScope):
+ (JSC::BytecodeGenerator::createActivationIfNecessary): Deleted.
+ * bytecompiler/BytecodeGenerator.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_create_activation):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_create_activation):
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+
2014-08-14 Tomas Popela <tpop...@redhat.com>
Add support for ppc, ppc64, ppc64le, s390, s390x into the CMake build
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (172593 => 172594)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2014-08-14 18:07:00 UTC (rev 172594)
@@ -248,6 +248,8 @@
m_activationRegister = addVar();
emitInitLazyRegister(m_activationRegister);
m_codeBlock->setActivationRegister(m_activationRegister->virtualRegister());
+ emitOpcode(op_create_activation);
+ instructions().append(m_activationRegister->index());
}
m_symbolTable->setCaptureStart(virtualRegisterForLocal(m_codeBlock->m_numVars).offset());
@@ -1642,7 +1644,6 @@
RegisterID* BytecodeGenerator::emitNewFunctionInternal(RegisterID* dst, CaptureMode captureMode, unsigned index, bool doNullCheck)
{
- createActivationIfNecessary();
emitOpcode(captureMode == IsCaptured ? op_new_captured_func : op_new_func);
instructions().append(dst->index());
instructions().append(index);
@@ -1666,8 +1667,7 @@
{
FunctionBodyNode* function = n->body();
unsigned index = m_codeBlock->addFunctionExpr(makeFunction(function));
-
- createActivationIfNecessary();
+
emitOpcode(op_new_func_exp);
instructions().append(r0->index());
instructions().append(index);
@@ -1695,17 +1695,8 @@
ASSERT(!hasWatchableVariable(m_codeBlock->argumentsRegister().offset()));
}
-void BytecodeGenerator::createActivationIfNecessary()
-{
- if (!m_activationRegister)
- return;
- emitOpcode(op_create_activation);
- instructions().append(m_activationRegister->index());
-}
-
RegisterID* BytecodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, CallArguments& callArguments, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
{
- createActivationIfNecessary();
return emitCall(op_call_eval, dst, func, NoExpectedFunction, callArguments, divot, divotStart, divotEnd);
}
@@ -2010,7 +2001,6 @@
m_scopeContextStack.append(context);
m_localScopeDepth++;
- createActivationIfNecessary();
return emitUnaryNoDstOp(op_push_with_scope, scope);
}
@@ -2336,8 +2326,6 @@
void BytecodeGenerator::emitPushCatchScope(const Identifier& property, RegisterID* value, unsigned attributes)
{
- createActivationIfNecessary();
-
ControlFlowContext context;
context.isFinallyBlock = false;
m_scopeContextStack.append(context);
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h (172593 => 172594)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2014-08-14 18:07:00 UTC (rev 172594)
@@ -678,7 +678,6 @@
RegisterID* emitThrowExpressionTooDeepException();
void createArgumentsIfNecessary();
- void createActivationIfNecessary();
RegisterID* createLazyRegisterIfNecessary(RegisterID*);
unsigned watchableVariable(int operand)
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (172593 => 172594)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2014-08-14 18:07:00 UTC (rev 172594)
@@ -679,11 +679,9 @@
void JIT::emit_op_create_activation(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
-
- Jump activationCreated = branchTest64(NonZero, Address(callFrameRegister, sizeof(Register) * dst));
+
callOperation(operationCreateActivation, 0);
emitStoreCell(dst, returnValueGPR);
- activationCreated.link(this);
}
void JIT::emit_op_create_arguments(Instruction* currentInstruction)
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (172593 => 172594)
--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2014-08-14 18:07:00 UTC (rev 172594)
@@ -905,11 +905,9 @@
void JIT::emit_op_create_activation(Instruction* currentInstruction)
{
int activation = currentInstruction[1].u.operand;
-
- Jump activationCreated = branch32(NotEqual, tagFor(activation), TrustedImm32(JSValue::EmptyValueTag));
+
callOperation(operationCreateActivation, 0);
emitStoreCell(activation, returnValueGPR);
- activationCreated.link(this);
}
void JIT::emit_op_create_arguments(Instruction* currentInstruction)
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (172593 => 172594)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm 2014-08-14 18:07:00 UTC (rev 172594)
@@ -697,9 +697,7 @@
_llint_op_create_activation:
traceExecution()
loadi 4[PC], t0
- bineq TagOffset[cfr, t0, 8], EmptyValueTag, .opCreateActivationDone
callSlowPath(_llint_slow_path_create_activation)
-.opCreateActivationDone:
dispatch(2)
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (172593 => 172594)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2014-08-14 17:59:53 UTC (rev 172593)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm 2014-08-14 18:07:00 UTC (rev 172594)
@@ -624,9 +624,7 @@
_llint_op_create_activation:
traceExecution()
loadisFromInstruction(1, t0)
- bqneq [cfr, t0, 8], ValueEmpty, .opCreateActivationDone
callSlowPath(_llint_slow_path_create_activation)
-.opCreateActivationDone:
dispatch(2)