diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
commit | ee4c86d1990a9e26277a6948e7027ad8d525ebfa (patch) | |
tree | 1e2d3408cd097606571f40ab63353c27bcb7dd5c /Source/JavaScriptCore/bytecode | |
parent | d882bec96d0d30aeeda2141bfadfca7f038ee862 (diff) | |
download | qtwebkit-ee4c86d1990a9e26277a6948e7027ad8d525ebfa.tar.gz |
Imported WebKit commit 795dcd25a9649fccaf1c9b685f6e2ffedaf7e620 (http://svn.webkit.org/repository/webkit/trunk@131718)
New snapshot that includes the return of -fkeep-memory at link time
to reduce memory pressure as well as modularized documentation
Diffstat (limited to 'Source/JavaScriptCore/bytecode')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeBlock.cpp | 11 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/Opcode.h | 1 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/ResolveOperation.h | 178 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/SpecialPointer.h | 2 |
4 files changed, 190 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp index 9b8260a79..d1151482e 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp @@ -704,6 +704,13 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator& dumpBytecodeCommentAndNewLine(location); break; } + case op_new_array_with_size: { + int dst = (++it)->u.operand; + int length = (++it)->u.operand; + dataLog("[%4d] new_array_with_size\t %s, %s", location, registerName(exec, dst).data(), registerName(exec, length).data()); + dumpBytecodeCommentAndNewLine(location); + break; + } case op_new_array_buffer: { int dst = (++it)->u.operand; int argv = (++it)->u.operand; @@ -1245,9 +1252,9 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator& } case op_jneq_ptr: { int r0 = (++it)->u.operand; - void* pointer = (++it)->u.pointer; + Special::Pointer pointer = (++it)->u.specialPointer; int offset = (++it)->u.operand; - dataLog("[%4d] jneq_ptr\t\t %s, %p, %d(->%d)", location, registerName(exec, r0).data(), pointer, offset, location + offset); + dataLog("[%4d] jneq_ptr\t\t %s, %d (%p), %d(->%d)", location, registerName(exec, r0).data(), pointer, m_globalObject->actualPointerFor(pointer), offset, location + offset); dumpBytecodeCommentAndNewLine(location); break; } diff --git a/Source/JavaScriptCore/bytecode/Opcode.h b/Source/JavaScriptCore/bytecode/Opcode.h index a5d466154..dd62df700 100644 --- a/Source/JavaScriptCore/bytecode/Opcode.h +++ b/Source/JavaScriptCore/bytecode/Opcode.h @@ -49,6 +49,7 @@ namespace JSC { \ macro(op_new_object, 2) \ macro(op_new_array, 4) \ + macro(op_new_array_with_size, 3) \ macro(op_new_array_buffer, 4) \ macro(op_new_regexp, 3) \ macro(op_mov, 3) \ diff --git a/Source/JavaScriptCore/bytecode/ResolveOperation.h b/Source/JavaScriptCore/bytecode/ResolveOperation.h new file mode 100644 index 000000000..1543ef209 --- /dev/null +++ b/Source/JavaScriptCore/bytecode/ResolveOperation.h @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ResolveOperation_h +#define ResolveOperation_h + +#include "PropertyOffset.h" +#include "WriteBarrier.h" + +#include <wtf/Vector.h> + +namespace JSC { + +class Structure; + +struct ResolveOperation { + typedef enum { + Fail, + SetBaseToUndefined, + ReturnScopeAsBase, + SetBaseToScope, + SetBaseToGlobal, + GetAndReturnScopedVar, + GetAndReturnGlobalVar, + GetAndReturnGlobalVarWatchable, + SkipTopScopeNode, + SkipScopes, + ReturnGlobalObjectAsBase, + GetAndReturnGlobalProperty, + CheckForDynamicEntriesBeforeGlobalScope + } ResolveOperationType; + + ResolveOperationType m_operation; + WriteBarrier<Structure> m_structure; + union { + PropertyOffset m_offset; + WriteBarrier<Unknown>* m_registerAddress; + int m_scopesToSkip; + int m_activationRegister; + }; + static ResolveOperation getAndReturnScopedVar(PropertyOffset offset) + { + ResolveOperation op; + op.m_operation = GetAndReturnScopedVar; + op.m_offset = offset; + return op; + } + static ResolveOperation checkForDynamicEntriesBeforeGlobalScope() + { + ResolveOperation op; + op.m_operation = CheckForDynamicEntriesBeforeGlobalScope; + return op; + } + + static ResolveOperation getAndReturnGlobalVar(WriteBarrier<Unknown>* registerAddress, bool couldBeWatched) + { + ResolveOperation op; + op.m_operation = couldBeWatched ? GetAndReturnGlobalVarWatchable : GetAndReturnGlobalVar; + op.m_registerAddress = registerAddress; + return op; + } + static ResolveOperation getAndReturnGlobalProperty() + { + ResolveOperation op; + op.m_operation = GetAndReturnGlobalProperty; + return op; + } + static ResolveOperation resolveFail() + { + ResolveOperation op; + op.m_operation = Fail; + return op; + } + static ResolveOperation skipTopScopeNode(int activationRegister) + { + ResolveOperation op; + op.m_operation = SkipTopScopeNode; + op.m_activationRegister = activationRegister; + return op; + } + static ResolveOperation skipScopes(int scopesToSkip) + { + ResolveOperation op; + op.m_operation = SkipScopes; + op.m_scopesToSkip = scopesToSkip; + return op; + } + static ResolveOperation returnGlobalObjectAsBase() + { + ResolveOperation op; + op.m_operation = ReturnGlobalObjectAsBase; + return op; + } + static ResolveOperation setBaseToGlobal() + { + ResolveOperation op; + op.m_operation = SetBaseToGlobal; + return op; + } + static ResolveOperation setBaseToUndefined() + { + ResolveOperation op; + op.m_operation = SetBaseToUndefined; + return op; + } + static ResolveOperation setBaseToScope() + { + ResolveOperation op; + op.m_operation = SetBaseToScope; + return op; + } + static ResolveOperation returnScopeAsBase() + { + ResolveOperation op; + op.m_operation = ReturnScopeAsBase; + return op; + } +}; + +typedef Vector<ResolveOperation> ResolveOperations; + +struct PutToBaseOperation { + PutToBaseOperation(bool isStrict) + : m_kind(Uninitialised) + , m_isDynamic(false) + , m_isStrict(isStrict) + , m_predicatePointer(0) + { + + } + enum Kind { Uninitialised, Generic, Readonly, GlobalVariablePut, GlobalVariablePutChecked, GlobalPropertyPut, VariablePut }; + union { + Kind m_kind : 8; + uint8_t m_kindAsUint8; + }; + bool m_isDynamic : 8; + bool m_isStrict : 8; + union { + bool* m_predicatePointer; + unsigned m_scopeDepth; + }; + WriteBarrier<Structure> m_structure; + union { + // Used for GlobalVariablePut + WriteBarrier<Unknown>* m_registerAddress; + + // Used for GlobalPropertyPut and VariablePut + struct { + PropertyOffset m_offset; + int32_t m_offsetInButterfly; + }; + }; +}; +} + +#endif // ResolveOperation_h diff --git a/Source/JavaScriptCore/bytecode/SpecialPointer.h b/Source/JavaScriptCore/bytecode/SpecialPointer.h index 2c624784b..c18a6e904 100644 --- a/Source/JavaScriptCore/bytecode/SpecialPointer.h +++ b/Source/JavaScriptCore/bytecode/SpecialPointer.h @@ -35,6 +35,8 @@ namespace Special { enum Pointer { CallFunction, ApplyFunction, + ObjectConstructor, + ArrayConstructor, TableSize // Not a real special pointer. Use this to determine the number of pointers. }; } // namespace Special |