Changeset 38230 in webkit for trunk/JavaScriptCore/bytecompiler


Ignore:
Timestamp:
Nov 7, 2008, 1:15:18 PM (17 years ago)
Author:
[email protected]
Message:

2008-11-07 Cameron Zwarich <[email protected]>

Reviewed by Geoff Garen.

Bug 21801: REGRESSION (r37821): YUI date formatting JavaScript puts the letter 'd' in place of the day
<https://bugs.webkit.org/show_bug.cgi?id=21801>

Fix the constant register check in the 'typeof' optimization in
CodeGenerator, which was completely broken after r37821.

JavaScriptCore:

  • bytecompiler/CodeGenerator.cpp: (JSC::CodeGenerator::emitEqualityOp):

LayoutTests:

  • fast/js/resources/typeof-constant-string.js: Added.
  • fast/js/typeof-constant-string-expected.txt: Added.
  • fast/js/typeof-constant-string.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp

    r38219 r38230  
    784784        if (src1->index() == dstIndex
    785785            && src1->isTemporary()
    786             && static_cast<unsigned>(src2->index()) < m_codeBlock->constantRegisters.size()
    787             && m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec())->isString()) {
    788             const UString& value = asString(m_codeBlock->constantRegisters[src2->index()].jsValue(m_scopeChain->globalObject()->globalExec()))->value();
     786            && m_codeBlock->isConstant(src2->index())
     787            && m_codeBlock->constantRegisters[src2->index() - m_codeBlock->numVars].jsValue(m_scopeChain->globalObject()->globalExec())->isString()) {
     788            const UString& value = asString(m_codeBlock->constantRegisters[src2->index() - m_codeBlock->numVars].jsValue(m_scopeChain->globalObject()->globalExec()))->value();
    789789            if (value == "undefined") {
    790790                rewindUnaryOp();
Note: See TracChangeset for help on using the changeset viewer.