From dd91e772430dc294e3bf478c119ef8d43c0a3358 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 12 Mar 2012 14:11:15 +0100 Subject: Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422) This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API. --- Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp | 15 ++++++++++++--- Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h | 9 +++++++-- Source/JavaScriptCore/bytecompiler/Label.h | 15 ++++----------- Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp | 14 +++++++++++--- 4 files changed, 34 insertions(+), 19 deletions(-) (limited to 'Source/JavaScriptCore/bytecompiler') diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 6fa0ce96b..4a6f4653e 100644 --- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -119,6 +119,15 @@ namespace JSC { expected by the callee. */ +void Label::setLocation(unsigned location) +{ + m_location = location; + + unsigned size = m_unresolvedJumps.size(); + for (unsigned i = 0; i < size; ++i) + m_generator->m_instructions[m_unresolvedJumps[i].second].u.operand = m_location - m_unresolvedJumps[i].first; +} + #ifndef NDEBUG void ResolveResult::checkValidity() { @@ -171,8 +180,8 @@ JSObject* BytecodeGenerator::generate() m_codeBlock->setThisRegister(m_thisRegister.index()); m_scopeNode->emitBytecode(*this); - - m_codeBlock->setInstructionCount(m_codeBlock->instructions().size()); + + m_codeBlock->instructions() = RefCountedArray(m_instructions); if (s_dumpsGeneratedCode) m_codeBlock->dump(m_scopeChain->globalObject->globalExec()); @@ -607,7 +616,7 @@ PassRefPtr