Ignore:
Timestamp:
Apr 20, 2010, 11:41:20 PM (15 years ago)
Author:
[email protected]
Message:

2010-04-20 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

[ES5] RegExp literals are constants that should be persistent across multiple function calls.
https://bugs.webkit.org/show_bug.cgi?id=37908

Dump the separate RegExp constant pool, and just use the standard JS constant pool
in codeblock. This allows us to drop op_new_regexp and all associated code as well.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::shrinkToFit):
  • bytecode/CodeBlock.h:
  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitLoad):
  • bytecompiler/BytecodeGenerator.h:
  • bytecompiler/NodesCodegen.cpp: (JSC::RegExpNode::emitBytecode):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
  • jit/JIT.h:
  • jit/JITOpcodes.cpp:
  • jit/JITStubs.cpp:
  • jit/JITStubs.h: (JSC::):

2010-04-20 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

[ES5] RegExp literals are constants that should be persistent across multiple function calls.
https://bugs.webkit.org/show_bug.cgi?id=37908

Add tests to ensure correct persistence of RegExp literals, and correctly avoid
sharing "identical" regexps used in different places.

  • fast/js/regexp-literals-are-constants-expected.txt: Added.
  • fast/js/regexp-literals-are-constants.html: Added.
  • fast/js/script-tests/regexp-literals-are-constants.js: Added. (test1): (returnRegExpLiteral): (returnConditionalRegExpLiteral):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITOpcodes.cpp

    r56759 r57955  
    11711171    JITStubCall stubCall(this, cti_op_new_func_exp);
    11721172    stubCall.addArgument(ImmPtr(m_codeBlock->functionExpr(currentInstruction[2].u.operand)));
    1173     stubCall.call(currentInstruction[1].u.operand);
    1174 }
    1175 
    1176 void JIT::emit_op_new_regexp(Instruction* currentInstruction)
    1177 {
    1178     JITStubCall stubCall(this, cti_op_new_regexp);
    1179     stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
    11801173    stubCall.call(currentInstruction[1].u.operand);
    11811174}
     
    24472440}
    24482441
    2449 void JIT::emit_op_new_regexp(Instruction* currentInstruction)
    2450 {
    2451     JITStubCall stubCall(this, cti_op_new_regexp);
    2452     stubCall.addArgument(ImmPtr(m_codeBlock->regexp(currentInstruction[2].u.operand)));
    2453     stubCall.call(currentInstruction[1].u.operand);
    2454 }
    2455 
    24562442void JIT::emit_op_bitor(Instruction* currentInstruction)
    24572443{
Note: See TracChangeset for help on using the changeset viewer.