Ignore:
Timestamp:
Jul 4, 2011, 12:26:05 PM (14 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=63881
Need separate bytecodes for handling >, >= comparisons.

Reviewed by Oliver Hunt.

This clears the way to fix Bug#63880. We currently handle greater-than comparisons
as being using the corresponding op_less, etc opcodes. This is incorrect with
respect to evaluation ordering of the implicit conversions performed on operands -
we should be calling ToPrimitive on the LHS and RHS operands to the greater than,
but instead convert RHS then LHS.

This patch adds opcodes for greater-than comparisons mirroring existing ones used
for less-than.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dump):

  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):

  • bytecompiler/NodesCodegen.cpp:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGNode.h:
  • dfg/DFGNonSpeculativeJIT.cpp:

(JSC::DFG::NonSpeculativeJIT::compare):
(JSC::DFG::NonSpeculativeJIT::compile):

  • dfg/DFGNonSpeculativeJIT.h:
  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compare):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT.h:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:

(JSC::JIT::emit_op_loop_if_greater):
(JSC::JIT::emitSlow_op_loop_if_greater):
(JSC::JIT::emit_op_loop_if_greatereq):
(JSC::JIT::emitSlow_op_loop_if_greatereq):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_jgreater):
(JSC::JIT::emit_op_jgreatereq):
(JSC::JIT::emit_op_jngreater):
(JSC::JIT::emit_op_jngreatereq):
(JSC::JIT::emitSlow_op_jgreater):
(JSC::JIT::emitSlow_op_jgreatereq):
(JSC::JIT::emitSlow_op_jngreater):
(JSC::JIT::emitSlow_op_jngreatereq):
(JSC::JIT::emit_compareAndJumpSlow):

  • jit/JITArithmetic32_64.cpp:

(JSC::JIT::emitBinaryDoubleOp):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • jit/JITStubs.h:
  • parser/NodeConstructors.h:

(JSC::GreaterNode::GreaterNode):
(JSC::GreaterEqNode::GreaterEqNode):

  • parser/Nodes.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r90352 r90371  
     12011-07-04  Gavin Barraclough  <[email protected]>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=63881
     4        Need separate bytecodes for handling >, >= comparisons.
     5
     6        Reviewed by Oliver Hunt.
     7
     8        This clears the way to fix Bug#63880. We currently handle greater-than comparisons
     9        as being using the corresponding op_less, etc opcodes.  This is incorrect with
     10        respect to evaluation ordering of the implicit conversions performed on operands -
     11        we should be calling ToPrimitive on the LHS and RHS operands to the greater than,
     12        but instead convert RHS then LHS.
     13
     14        This patch adds opcodes for greater-than comparisons mirroring existing ones used
     15        for less-than.
     16
     17        * bytecode/CodeBlock.cpp:
     18        (JSC::CodeBlock::dump):
     19        * bytecode/Opcode.h:
     20        * bytecompiler/BytecodeGenerator.cpp:
     21        (JSC::BytecodeGenerator::emitJumpIfTrue):
     22        (JSC::BytecodeGenerator::emitJumpIfFalse):
     23        * bytecompiler/NodesCodegen.cpp:
     24        * dfg/DFGByteCodeParser.cpp:
     25        (JSC::DFG::ByteCodeParser::parseBlock):
     26        * dfg/DFGNode.h:
     27        * dfg/DFGNonSpeculativeJIT.cpp:
     28        (JSC::DFG::NonSpeculativeJIT::compare):
     29        (JSC::DFG::NonSpeculativeJIT::compile):
     30        * dfg/DFGNonSpeculativeJIT.h:
     31        * dfg/DFGOperations.cpp:
     32        * dfg/DFGOperations.h:
     33        * dfg/DFGSpeculativeJIT.cpp:
     34        (JSC::DFG::SpeculativeJIT::compare):
     35        (JSC::DFG::SpeculativeJIT::compile):
     36        * dfg/DFGSpeculativeJIT.h:
     37        * interpreter/Interpreter.cpp:
     38        (JSC::Interpreter::privateExecute):
     39        * jit/JIT.cpp:
     40        (JSC::JIT::privateCompileMainPass):
     41        (JSC::JIT::privateCompileSlowCases):
     42        * jit/JIT.h:
     43        (JSC::JIT::emit_op_loop_if_greater):
     44        (JSC::JIT::emitSlow_op_loop_if_greater):
     45        (JSC::JIT::emit_op_loop_if_greatereq):
     46        (JSC::JIT::emitSlow_op_loop_if_greatereq):
     47        * jit/JITArithmetic.cpp:
     48        (JSC::JIT::emit_op_jgreater):
     49        (JSC::JIT::emit_op_jgreatereq):
     50        (JSC::JIT::emit_op_jngreater):
     51        (JSC::JIT::emit_op_jngreatereq):
     52        (JSC::JIT::emitSlow_op_jgreater):
     53        (JSC::JIT::emitSlow_op_jgreatereq):
     54        (JSC::JIT::emitSlow_op_jngreater):
     55        (JSC::JIT::emitSlow_op_jngreatereq):
     56        (JSC::JIT::emit_compareAndJumpSlow):
     57        * jit/JITArithmetic32_64.cpp:
     58        (JSC::JIT::emitBinaryDoubleOp):
     59        * jit/JITStubs.cpp:
     60        (JSC::DEFINE_STUB_FUNCTION):
     61        * jit/JITStubs.h:
     62        * parser/NodeConstructors.h:
     63        (JSC::GreaterNode::GreaterNode):
     64        (JSC::GreaterEqNode::GreaterEqNode):
     65        * parser/Nodes.h:
     66
    1672011-07-03  Gavin Barraclough  <[email protected]>
    268
Note: See TracChangeset for help on using the changeset viewer.