Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (220769 => 220770)
--- trunk/Source/_javascript_Core/ChangeLog 2017-08-15 22:50:21 UTC (rev 220769)
+++ trunk/Source/_javascript_Core/ChangeLog 2017-08-15 22:54:50 UTC (rev 220770)
@@ -1,5 +1,25 @@
2017-08-15 Keith Miller <[email protected]>
+ JSC named bytecode offsets should use references rather than pointers
+ https://bugs.webkit.org/show_bug.cgi?id=175601
+
+ Reviewed by Saam Barati.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_overrides_has_instance):
+ (JSC::JIT::emit_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof_custom):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_overrides_has_instance):
+ (JSC::JIT::emit_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof):
+ (JSC::JIT::emitSlow_op_instanceof_custom):
+
+2017-08-15 Keith Miller <[email protected]>
+
Enable named offsets into JSC bytecodes
https://bugs.webkit.org/show_bug.cgi?id=175561
Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (220769 => 220770)
--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2017-08-15 22:50:21 UTC (rev 220769)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp 2017-08-15 22:54:50 UTC (rev 220770)
@@ -4451,13 +4451,13 @@
}
case op_overrides_has_instance: {
- auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
+ auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
JSFunction* defaultHasInstanceSymbolFunction = m_inlineStackTop->m_codeBlock->globalObjectFor(currentCodeOrigin())->functionProtoHasInstanceSymbolFunction();
- Node* constructor = get(VirtualRegister(bytecode->constructor()));
- Node* hasInstanceValue = get(VirtualRegister(bytecode->hasInstanceValue()));
+ Node* constructor = get(VirtualRegister(bytecode.constructor()));
+ Node* hasInstanceValue = get(VirtualRegister(bytecode.hasInstanceValue()));
- set(VirtualRegister(bytecode->dst()), addToGraph(OverridesHasInstance, OpInfo(m_graph.freeze(defaultHasInstanceSymbolFunction)), constructor, hasInstanceValue));
+ set(VirtualRegister(bytecode.dst()), addToGraph(OverridesHasInstance, OpInfo(m_graph.freeze(defaultHasInstanceSymbolFunction)), constructor, hasInstanceValue));
NEXT_OPCODE(op_overrides_has_instance);
}
@@ -4469,19 +4469,19 @@
}
case op_instanceof: {
- auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
- Node* value = get(VirtualRegister(bytecode->value()));
- Node* prototype = get(VirtualRegister(bytecode->prototype()));
- set(VirtualRegister(bytecode->dst()), addToGraph(InstanceOf, value, prototype));
+ auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
+ Node* value = get(VirtualRegister(bytecode.value()));
+ Node* prototype = get(VirtualRegister(bytecode.prototype()));
+ set(VirtualRegister(bytecode.dst()), addToGraph(InstanceOf, value, prototype));
NEXT_OPCODE(op_instanceof);
}
case op_instanceof_custom: {
- auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
- Node* value = get(VirtualRegister(bytecode->value()));
- Node* constructor = get(VirtualRegister(bytecode->constructor()));
- Node* hasInstanceValue = get(VirtualRegister(bytecode->hasInstanceValue()));
- set(VirtualRegister(bytecode->dst()), addToGraph(InstanceOfCustom, value, constructor, hasInstanceValue));
+ auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
+ Node* value = get(VirtualRegister(bytecode.value()));
+ Node* constructor = get(VirtualRegister(bytecode.constructor()));
+ Node* hasInstanceValue = get(VirtualRegister(bytecode.hasInstanceValue()));
+ set(VirtualRegister(bytecode.dst()), addToGraph(InstanceOfCustom, value, constructor, hasInstanceValue));
NEXT_OPCODE(op_instanceof_custom);
}
case op_is_empty: {
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (220769 => 220770)
--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2017-08-15 22:50:21 UTC (rev 220769)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp 2017-08-15 22:54:50 UTC (rev 220770)
@@ -113,10 +113,10 @@
void JIT::emit_op_overrides_has_instance(Instruction* currentInstruction)
{
- auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
- int dst = bytecode->dst();
- int constructor = bytecode->constructor();
- int hasInstanceValue = bytecode->hasInstanceValue();
+ auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
+ int dst = bytecode.dst();
+ int constructor = bytecode.constructor();
+ int hasInstanceValue = bytecode.hasInstanceValue();
emitGetVirtualRegister(hasInstanceValue, regT0);
@@ -139,10 +139,10 @@
void JIT::emit_op_instanceof(Instruction* currentInstruction)
{
- auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int proto = bytecode->prototype();
+ auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int proto = bytecode.prototype();
// 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.
@@ -863,10 +863,10 @@
void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int proto = bytecode->prototype();
+ auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int proto = bytecode.prototype();
linkSlowCaseIfNotJSCell(iter, value);
linkSlowCaseIfNotJSCell(iter, proto);
@@ -879,11 +879,11 @@
void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int constructor = bytecode->constructor();
- int hasInstanceValue = bytecode->hasInstanceValue();
+ auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int constructor = bytecode.constructor();
+ int hasInstanceValue = bytecode.hasInstanceValue();
linkSlowCase(iter);
emitGetVirtualRegister(value, regT0);
Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (220769 => 220770)
--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2017-08-15 22:50:21 UTC (rev 220769)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp 2017-08-15 22:54:50 UTC (rev 220770)
@@ -193,10 +193,10 @@
void JIT::emit_op_overrides_has_instance(Instruction* currentInstruction)
{
- auto bytecode = reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
- int dst = bytecode->dst();
- int constructor = bytecode->constructor();
- int hasInstanceValue = bytecode->hasInstanceValue();
+ auto& bytecode = *reinterpret_cast<OpOverridesHasInstance*>(currentInstruction);
+ int dst = bytecode.dst();
+ int constructor = bytecode.constructor();
+ int hasInstanceValue = bytecode.hasInstanceValue();
emitLoadPayload(hasInstanceValue, regT0);
// We don't jump if we know what Symbol.hasInstance would do.
@@ -221,10 +221,10 @@
void JIT::emit_op_instanceof(Instruction* currentInstruction)
{
- auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int proto = bytecode->prototype();
+ auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int proto = bytecode.prototype();
// 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.
@@ -269,10 +269,10 @@
void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- auto bytecode = reinterpret_cast<OpInstanceof*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int proto = bytecode->prototype();
+ auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int proto = bytecode.prototype();
linkSlowCaseIfNotJSCell(iter, value);
linkSlowCaseIfNotJSCell(iter, proto);
@@ -286,11 +286,11 @@
void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
- auto bytecode = reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
- int dst = bytecode->dst();
- int value = bytecode->value();
- int constructor = bytecode->constructor();
- int hasInstanceValue = bytecode->hasInstanceValue();
+ auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
+ int dst = bytecode.dst();
+ int value = bytecode.value();
+ int constructor = bytecode.constructor();
+ int hasInstanceValue = bytecode.hasInstanceValue();
linkSlowCase(iter);