Commit 70165470 authored by mark.lam@apple.com's avatar mark.lam@apple.com

Need ExpressionRangeInfo before ResolveForPuts in strict mode.

https://bugs.webkit.org/show_bug.cgi?id=118997.

Reviewed by Oliver Hunt.

If we add an assertion in UnlinkedCodeBlock::expressionRangeForBytecodeOffset()
to ensure that we are able to find an ExpressionRangeInfo for any given bytecode
offset, the following tests will fails:
    fast/js/basic-strict-mode.html
    fast/js/mozilla/strict/8.7.2.html
With this fix, those tests will no longer fail.

* bytecompiler/NodesCodegen.cpp:
(JSC::AssignResolveNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
- Emit expression info before calls to emitResolveBaseForPut() when in strict mode.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0e3a6ace
2013-07-10 Mark Lam <mark.lam@apple.com>
Need ExpressionRangeInfo before ResolveForPuts in strict mode.
https://bugs.webkit.org/show_bug.cgi?id=118997.
Reviewed by Oliver Hunt.
If we add an assertion in UnlinkedCodeBlock::expressionRangeForBytecodeOffset()
to ensure that we are able to find an ExpressionRangeInfo for any given bytecode
offset, the following tests will fails:
fast/js/basic-strict-mode.html
fast/js/mozilla/strict/8.7.2.html
With this fix, those tests will no longer fail.
* bytecompiler/NodesCodegen.cpp:
(JSC::AssignResolveNode::emitBytecode):
(JSC::ForInNode::emitBytecode):
- Emit expression info before calls to emitResolveBaseForPut() when in strict mode.
2013-07-23 Mark Lam <mark.lam@apple.com>
Added ExpressionRangeInfo for BinaryOpNodes that can throw exceptions
......
......@@ -1361,6 +1361,8 @@ RegisterID* AssignResolveNode::emitBytecode(BytecodeGenerator& generator, Regist
}
NonlocalResolveInfo resolveVerifier;
if (generator.isStrictMode())
generator.emitExpressionInfo(divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());
RefPtr<RegisterID> base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, m_ident, resolveVerifier);
if (dst == generator.ignoredResult())
dst = 0;
......@@ -1739,6 +1741,8 @@ void ForInNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
propertyName = generator.newTemporary();
RefPtr<RegisterID> protect = propertyName;
NonlocalResolveInfo resolveVerifier;
if (generator.isStrictMode())
generator.emitExpressionInfo(divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());
RegisterID* base = generator.emitResolveBaseForPut(generator.newTemporary(), resolveResult, ident, resolveVerifier);
generator.emitExpressionInfo(divot(), divotStartOffset(), divotEndOffset(), divotLine(), divotLineStart());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment