Ignore:
Timestamp:
Jun 28, 2011, 1:21:37 PM (14 years ago)
Author:
[email protected]
Message:

2011-06-28 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Make constant array optimisation less strict about what constitutes a constant
https://bugs.webkit.org/show_bug.cgi?id=63554

Now allow string constants in array literals to actually be considered constant,
and so avoid codegen in array literals with strings in them.

  • bytecode/CodeBlock.h: (JSC::CodeBlock::addConstantBuffer): (JSC::CodeBlock::constantBuffer):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addConstantBuffer): (JSC::BytecodeGenerator::addStringConstant): (JSC::BytecodeGenerator::emitNewArray):
  • bytecompiler/BytecodeGenerator.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r89465 r89954  
    16071607         Constructs a new Array instance using the original
    16081608         constructor, and puts the result in register dst.
    1609          The array be initialized with the values from immediateBuffer[index]
     1609         The array be initialized with the values from constantBuffer[index]
    16101610         */
    16111611        int dst = vPC[1].u.operand;
    16121612        int firstArg = vPC[2].u.operand;
    16131613        int argCount = vPC[3].u.operand;
    1614         ArgList args(codeBlock->immediateBuffer(firstArg), argCount);
     1614        ArgList args(codeBlock->constantBufferfirstArg), argCount);
    16151615        callFrame->uncheckedR(dst) = JSValue(constructArray(callFrame, args));
    16161616       
Note: See TracChangeset for help on using the changeset viewer.