Commit 094dbd98 authored by barraclough@apple.com's avatar barraclough@apple.com
Browse files

Remove redundant argument to op_instanceof

https://bugs.webkit.org/show_bug.cgi?id=97382

Reviewed by Geoff Garen.

No longer needed after my last change.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* bytecode/Opcode.h:
(JSC):
(JSC::padOpcodeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitInstanceOf):
* bytecompiler/BytecodeGenerator.h:
(BytecodeGenerator):
* bytecompiler/NodesCodegen.cpp:
(JSC::InstanceOfNode::emitBytecode):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileInstanceOf):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8b669c9d
2012-09-21 Gavin Barraclough <barraclough@apple.com>
Remove redundant argument to op_instanceof
https://bugs.webkit.org/show_bug.cgi?id=97382
Reviewed by Geoff Garen.
No longer needed after my last change.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dump):
* bytecode/Opcode.h:
(JSC):
(JSC::padOpcodeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitInstanceOf):
* bytecompiler/BytecodeGenerator.h:
(BytecodeGenerator):
* bytecompiler/NodesCodegen.cpp:
(JSC::InstanceOfNode::emitBytecode):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileInstanceOf):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
2012-09-21 Gavin Barraclough <barraclough@apple.com>
 
Unreviewed windows build fix.
......
......@@ -885,8 +885,7 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator&
int r0 = (++it)->u.operand;
int r1 = (++it)->u.operand;
int r2 = (++it)->u.operand;
int r3 = (++it)->u.operand;
dataLog("[%4d] instanceof\t\t %s, %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data(), registerName(exec, r3).data());
dataLog("[%4d] instanceof\t\t %s, %s, %s", location, registerName(exec, r0).data(), registerName(exec, r1).data(), registerName(exec, r2).data());
dumpBytecodeCommentAndNewLine(location);
break;
}
......
......@@ -85,7 +85,7 @@ namespace JSC {
macro(op_bitor, 5) \
\
macro(op_check_has_instance, 5) \
macro(op_instanceof, 5) \
macro(op_instanceof, 4) \
macro(op_typeof, 3) \
macro(op_is_undefined, 3) \
macro(op_is_boolean, 3) \
......
......@@ -1467,12 +1467,11 @@ void BytecodeGenerator::emitCheckHasInstance(RegisterID* dst, RegisterID* value,
instructions().append(target->bind(begin, instructions().size()));
}
RegisterID* BytecodeGenerator::emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* base, RegisterID* basePrototype)
RegisterID* BytecodeGenerator::emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* basePrototype)
{
emitOpcode(op_instanceof);
instructions().append(dst->index());
instructions().append(value->index());
instructions().append(base->index());
instructions().append(basePrototype->index());
return dst;
}
......
......@@ -456,7 +456,7 @@ namespace JSC {
RegisterID* emitPostDec(RegisterID* dst, RegisterID* srcDst);
void emitCheckHasInstance(RegisterID* dst, RegisterID* value, RegisterID* base, Label* target);
RegisterID* emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* base, RegisterID* basePrototype);
RegisterID* emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* basePrototype);
RegisterID* emitTypeOf(RegisterID* dst, RegisterID* src) { return emitUnaryOp(op_typeof, dst, src); }
RegisterID* emitIn(RegisterID* dst, RegisterID* property, RegisterID* base) { return emitBinaryOp(op_in, dst, property, base, OperandTypes()); }
......
......@@ -1099,7 +1099,7 @@ RegisterID* InstanceOfNode::emitBytecode(BytecodeGenerator& generator, RegisterI
generator.emitGetById(prototype.get(), src2.get(), generator.globalData()->propertyNames->prototype);
generator.emitExpressionInfo(divot(), startOffset(), endOffset());
RegisterID* result = generator.emitInstanceOf(dstReg.get(), src1.get(), src2.get(), prototype.get());
RegisterID* result = generator.emitInstanceOf(dstReg.get(), src1.get(), prototype.get());
generator.emitLabel(target.get());
return result;
}
......
......@@ -1477,7 +1477,7 @@ bool AbstractState::execute(unsigned indexInBlock)
// Again, sadly, we don't propagate the fact that we've done InstanceOf
if (!(m_graph[node.child1()].prediction() & ~SpecCell) && !(forNode(node.child1()).m_type & ~SpecCell))
forNode(node.child1()).filter(SpecCell);
forNode(node.child3()).filter(SpecCell);
forNode(node.child2()).filter(SpecCell);
forNode(nodeIndex).set(SpecBoolean);
break;
......
......@@ -2054,9 +2054,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
case op_instanceof: {
NodeIndex value = get(currentInstruction[2].u.operand);
NodeIndex baseValue = get(currentInstruction[3].u.operand);
NodeIndex prototype = get(currentInstruction[4].u.operand);
set(currentInstruction[1].u.operand, addToGraph(InstanceOf, value, baseValue, prototype));
NodeIndex prototype = get(currentInstruction[3].u.operand);
set(currentInstruction[1].u.operand, addToGraph(InstanceOf, value, prototype));
NEXT_OPCODE(op_instanceof);
}
......
......@@ -2416,8 +2416,7 @@ void SpeculativeJIT::compileInstanceOf(Node& node)
}
SpeculateCellOperand value(this, node.child1());
// Base unused since we speculate default InstanceOf behaviour in CheckHasInstance.
SpeculateCellOperand prototype(this, node.child3());
SpeculateCellOperand prototype(this, node.child2());
GPRTemporary scratch(this);
......
......@@ -2435,9 +2435,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
*/
int dst = vPC[1].u.operand;
int value = vPC[2].u.operand;
int baseProto = vPC[4].u.operand;
ASSERT(callFrame->r(vPC[3].u.operand).jsValue().isObject() && asObject(callFrame->r(vPC[3].u.operand).jsValue())->structure()->typeInfo().implementsDefaultHasInstance());
int baseProto = vPC[3].u.operand;
bool result = JSObject::defaultHasInstance(callFrame, callFrame->r(value).jsValue(), callFrame->r(baseProto).jsValue());
CHECK_FOR_EXCEPTION();
......
......@@ -423,7 +423,7 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
unsigned value = currentInstruction[2].u.operand;
unsigned proto = currentInstruction[4].u.operand;
unsigned proto = currentInstruction[3].u.operand;
// Load the operands (baseVal, proto, and value respectively) into registers.
// We use regT0 for baseVal since we will be done with this first, and we can then use it for the result.
......@@ -1463,15 +1463,13 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
{
unsigned dst = currentInstruction[1].u.operand;
unsigned value = currentInstruction[2].u.operand;
unsigned baseVal = currentInstruction[3].u.operand;
unsigned proto = currentInstruction[4].u.operand;
unsigned proto = currentInstruction[3].u.operand;
linkSlowCaseIfNotJSCell(iter, value);
linkSlowCaseIfNotJSCell(iter, proto);
linkSlowCase(iter);
JITStubCall stubCall(this, cti_op_instanceof);
stubCall.addArgument(value, regT2);
stubCall.addArgument(baseVal, regT2);
stubCall.addArgument(proto, regT2);
stubCall.call(dst);
}
......
......@@ -559,7 +559,7 @@ void JIT::emit_op_instanceof(Instruction* currentInstruction)
{
unsigned dst = currentInstruction[1].u.operand;
unsigned value = currentInstruction[2].u.operand;
unsigned proto = currentInstruction[4].u.operand;
unsigned proto = currentInstruction[3].u.operand;
// Load the operands into registers.
// We use regT0 for baseVal since we will be done with this first, and we can then use it for the result.
......@@ -616,8 +616,7 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
{
unsigned dst = currentInstruction[1].u.operand;
unsigned value = currentInstruction[2].u.operand;
unsigned baseVal = currentInstruction[3].u.operand;
unsigned proto = currentInstruction[4].u.operand;
unsigned proto = currentInstruction[3].u.operand;
linkSlowCaseIfNotJSCell(iter, value);
linkSlowCaseIfNotJSCell(iter, proto);
......@@ -625,7 +624,6 @@ void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCas
JITStubCall stubCall(this, cti_op_instanceof);
stubCall.addArgument(value);
stubCall.addArgument(baseVal);
stubCall.addArgument(proto);
stubCall.call(dst);
}
......
......@@ -2088,9 +2088,8 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_instanceof)
CallFrame* callFrame = stackFrame.callFrame;
JSValue value = stackFrame.args[0].jsValue();
JSValue proto = stackFrame.args[2].jsValue();
JSValue proto = stackFrame.args[1].jsValue();
ASSERT(stackFrame.args[1].jsValue().isObject() && asObject(stackFrame.args[1].jsValue())->structure()->typeInfo().implementsDefaultHasInstance());
ASSERT(!value.isObject() || !proto.isObject());
bool result = JSObject::defaultHasInstance(callFrame, value, proto);
......
......@@ -736,8 +736,7 @@ LLINT_SLOW_PATH_DECL(slow_path_instanceof)
{
LLINT_BEGIN();
JSValue value = LLINT_OP_C(2).jsValue();
JSValue proto = LLINT_OP_C(4).jsValue();
ASSERT(LLINT_OP_C(3).jsValue().isObject() && asObject(LLINT_OP_C(3).jsValue())->structure()->typeInfo().implementsDefaultHasInstance());
JSValue proto = LLINT_OP_C(3).jsValue();
ASSERT(!value.isObject() || !proto.isObject());
LLINT_RETURN(jsBoolean(JSObject::defaultHasInstance(exec, value, proto)));
}
......
......@@ -847,7 +847,7 @@ _llint_op_check_has_instance:
_llint_op_instanceof:
traceExecution()
# Actually do the work.
loadi 16[PC], t0
loadi 12[PC], t0
loadi 4[PC], t3
loadConstantOrVariablePayload(t0, CellTag, t1, .opInstanceofSlow)
loadp JSCell::m_structure[t1], t2
......@@ -867,11 +867,11 @@ _llint_op_instanceof:
.opInstanceofDone:
storei BooleanTag, TagOffset[cfr, t3, 8]
storei t0, PayloadOffset[cfr, t3, 8]
dispatch(5)
dispatch(4)
.opInstanceofSlow:
callSlowPath(_llint_slow_path_instanceof)
dispatch(5)
dispatch(4)
_llint_op_is_undefined:
......
......@@ -705,7 +705,7 @@ _llint_op_check_has_instance:
_llint_op_instanceof:
traceExecution()
# Actually do the work.
loadis 32[PB, PC, 8], t0
loadis 24[PB, PC, 8], t0
loadis 8[PB, PC, 8], t3
loadConstantOrVariableCell(t0, t1, .opInstanceofSlow)
loadp JSCell::m_structure[t1], t2
......@@ -725,11 +725,11 @@ _llint_op_instanceof:
.opInstanceofDone:
orp ValueFalse, t0
storep t0, [cfr, t3, 8]
dispatch(5)
dispatch(4)
.opInstanceofSlow:
callSlowPath(_llint_slow_path_instanceof)
dispatch(5)
dispatch(4)
_llint_op_is_undefined:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment