X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..refs/heads/master:/bytecompiler/BytecodeGenerator.h diff --git a/bytecompiler/BytecodeGenerator.h b/bytecompiler/BytecodeGenerator.h index c828c72..1a9771e 100644 --- a/bytecompiler/BytecodeGenerator.h +++ b/bytecompiler/BytecodeGenerator.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2012, 2013 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2012-2015 Apple Inc. All rights reserved. * Copyright (C) 2008 Cameron Zwarich * Copyright (C) 2012 Igalia, S.L. * @@ -12,7 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -43,16 +43,20 @@ #include "Debugger.h" #include "Nodes.h" #include "StaticPropertyAnalyzer.h" +#include "TemplateRegistryKey.h" #include "UnlinkedCodeBlock.h" + +#include + #include #include #include + namespace JSC { class Identifier; - class Label; - class JSScope; + class JSTemplateRegistryKey; enum ExpectedFunction { NoExpectedFunction, @@ -62,25 +66,26 @@ namespace JSC { class CallArguments { public: - CallArguments(BytecodeGenerator& generator, ArgumentsNode* argumentsNode); + CallArguments(BytecodeGenerator&, ArgumentsNode*, unsigned additionalArguments = 0); RegisterID* thisRegister() { return m_argv[0].get(); } RegisterID* argumentRegister(unsigned i) { return m_argv[i + 1].get(); } - unsigned registerOffset() { return m_argv.last()->index() + CallFrame::offsetFor(argumentCountIncludingThis()); } - unsigned argumentCountIncludingThis() { return m_argv.size(); } + unsigned stackOffset() { return -m_argv[0]->index() + JSStack::CallFrameHeaderSize; } + unsigned argumentCountIncludingThis() { return m_argv.size() - m_padding; } RegisterID* profileHookRegister() { return m_profileHookRegister.get(); } ArgumentsNode* argumentsNode() { return m_argumentsNode; } private: - void newArgument(BytecodeGenerator&); - RefPtr m_profileHookRegister; ArgumentsNode* m_argumentsNode; Vector, 8, UnsafeVectorOverflow> m_argv; + unsigned m_padding; }; struct FinallyContext { StatementNode* finallyBlock; + RegisterID* iterator; + ThrowableExpressionData* enumerationNode; unsigned scopeContextStackSize; unsigned switchContextStackSize; unsigned forInContextStackSize; @@ -95,183 +100,199 @@ namespace JSC { FinallyContext finallyContext; }; - struct ForInContext { - RefPtr expectedSubscriptRegister; - RefPtr iterRegister; - RefPtr indexRegister; - RefPtr propertyRegister; - }; - - struct TryData { - RefPtr