diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp index 2502fa839..fedb8711b 100644 --- a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp +++ b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013, 2015 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,7 +10,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 Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Computer, 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. * @@ -29,44 +29,48 @@ #include "config.h" #include "JSSegmentedVariableObject.h" -#include "JSCInlines.h" +#include "Operations.h" namespace JSC { -ScopeOffset JSSegmentedVariableObject::findVariableIndex(void* variableAddress) +int JSSegmentedVariableObject::findRegisterIndex(void* registerAddress) { ConcurrentJITLocker locker(m_lock); - for (unsigned i = m_variables.size(); i--;) { - if (&m_variables[i] != variableAddress) + for (int i = m_registers.size(); i--;) { + if (&m_registers[i] != registerAddress) continue; - return ScopeOffset(i); + return i; } CRASH(); - return ScopeOffset(); + return -1; } -ScopeOffset JSSegmentedVariableObject::addVariables(unsigned numberOfVariablesToAdd) +int JSSegmentedVariableObject::addRegisters(int numberOfRegistersToAdd) { ConcurrentJITLocker locker(m_lock); - size_t oldSize = m_variables.size(); - m_variables.grow(oldSize + numberOfVariablesToAdd); + ASSERT(numberOfRegistersToAdd >= 0); - for (size_t i = numberOfVariablesToAdd; i--;) - m_variables[oldSize + i].setWithoutWriteBarrier(jsUndefined()); + size_t oldSize = m_registers.size(); + m_registers.grow(oldSize + numberOfRegistersToAdd); - return ScopeOffset(oldSize); + for (size_t i = numberOfRegistersToAdd; i--;) + m_registers[oldSize + i].setWithoutWriteBarrier(jsUndefined()); + + return static_cast<int>(oldSize); } void JSSegmentedVariableObject::visitChildren(JSCell* cell, SlotVisitor& slotVisitor) { JSSegmentedVariableObject* thisObject = jsCast<JSSegmentedVariableObject*>(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); + COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag); + ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren()); JSSymbolTableObject::visitChildren(thisObject, slotVisitor); - for (unsigned i = thisObject->m_variables.size(); i--;) - slotVisitor.append(&thisObject->m_variables[i]); + for (unsigned i = thisObject->m_registers.size(); i--;) + slotVisitor.append(&thisObject->m_registers[i]); } } // namespace JSC |