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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172594
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-08-14 Oliver Hunt <oliver@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 <oliver@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 <tpopela@redhat.com>
Add support for ppc, ppc64, ppc64le, s390, s390x into the CMake build
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());
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);
{
FunctionBodyNode* function = n->body();
unsigned index = m_codeBlock->addFunctionExpr(makeFunction(function));
-
- createActivationIfNecessary();
+
emitOpcode(op_new_func_exp);
instructions().append(r0->index());
instructions().append(index);
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);
}
m_scopeContextStack.append(context);
m_localScopeDepth++;
- createActivationIfNecessary();
return emitUnaryNoDstOp(op_push_with_scope, scope);
}
void BytecodeGenerator::emitPushCatchScope(const Identifier& property, RegisterID* value, unsigned attributes)
{
- createActivationIfNecessary();
-
ControlFlowContext context;
context.isFinallyBlock = false;
m_scopeContextStack.append(context);
RegisterID* emitThrowExpressionTooDeepException();
void createArgumentsIfNecessary();
- void createActivationIfNecessary();
RegisterID* createLazyRegisterIfNecessary(RegisterID*);
unsigned watchableVariable(int operand)
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)
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)
_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)
_llint_op_create_activation:
traceExecution()
loadisFromInstruction(1, t0)
- bqneq [cfr, t0, 8], ValueEmpty, .opCreateActivationDone
callSlowPath(_llint_slow_path_create_activation)
-.opCreateActivationDone:
dispatch(2)