Commit 47a6aeb2 authored by barraclough@apple.com's avatar barraclough@apple.com

Removed another deprecatedAppend

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

Patch by Geoffrey Garen <ggaren@apple.com> on 2011-03-15
Reviewed by Oliver Hunt.

* collector/handles/HandleHeap.cpp:
(JSC::HandleHeap::markStrongHandles):
* collector/handles/HandleHeap.h: Use HeapRootMarker, since handles are
marked directly by the Heap.

* runtime/Heap.cpp:
(JSC::Heap::markRoots): Ditto.



git-svn-id: svn://svn.chromium.org/blink/trunk@81197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4df4765f
...@@ -181,6 +181,32 @@ ...@@ -181,6 +181,32 @@
(JSC::MarkStack::appendValues): (JSC::MarkStack::appendValues):
(JSC::MarkStack::appendSlots): (JSC::MarkStack::appendSlots):
2011-03-15 Gavin Barraclough <barraclough@apple.com>
Rubber Stamped by Sam Weinig.
Bug 56420 - Remove ENABLE(JIT) code from ByteCompiler
Some methods have unnecessary differences in name/arguments for interpreter/JIT.
* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:
(JSC::HandlerInfo::HandlerInfo):
(JSC::CodeBlock::addPropertyAccessInfo):
(JSC::CodeBlock::addGlobalResolveInfo):
(JSC::CodeBlock::addCallLinkInfo):
(JSC::CodeBlock::globalResolveInfo):
* bytecode/Opcode.h:
* bytecode/StructureStubInfo.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitResolve):
(JSC::BytecodeGenerator::emitResolveWithBase):
(JSC::BytecodeGenerator::emitGetById):
(JSC::BytecodeGenerator::emitPutById):
(JSC::BytecodeGenerator::emitDirectPutById):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitConstruct):
(JSC::BytecodeGenerator::emitCatch):
2011-03-15 Gavin Barraclough <barraclough@apple.com> 2011-03-15 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig. Reviewed by Sam Weinig.
......
...@@ -1608,49 +1608,6 @@ void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& d ...@@ -1608,49 +1608,6 @@ void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& d
return; return;
} }
#if ENABLE(INTERPRETER)
bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset)
{
if (m_globalResolveInstructions.isEmpty())
return false;
int low = 0;
int high = m_globalResolveInstructions.size();
while (low < high) {
int mid = low + (high - low) / 2;
if (m_globalResolveInstructions[mid] <= bytecodeOffset)
low = mid + 1;
else
high = mid;
}
if (!low || m_globalResolveInstructions[low - 1] != bytecodeOffset)
return false;
return true;
}
#endif
#if ENABLE(JIT)
bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset)
{
if (m_globalResolveInfos.isEmpty())
return false;
int low = 0;
int high = m_globalResolveInfos.size();
while (low < high) {
int mid = low + (high - low) / 2;
if (m_globalResolveInfos[mid].bytecodeOffset <= bytecodeOffset)
low = mid + 1;
else
high = mid;
}
if (!low || m_globalResolveInfos[low - 1].bytecodeOffset != bytecodeOffset)
return false;
return true;
}
#endif
void CodeBlock::shrinkToFit() void CodeBlock::shrinkToFit()
{ {
m_instructions.shrinkToFit(); m_instructions.shrinkToFit();
......
...@@ -37,16 +37,13 @@ ...@@ -37,16 +37,13 @@
#include "JumpTable.h" #include "JumpTable.h"
#include "Nodes.h" #include "Nodes.h"
#include "RegExp.h" #include "RegExp.h"
#include "StructureStubInfo.h"
#include "UString.h" #include "UString.h"
#include <wtf/FastAllocBase.h> #include <wtf/FastAllocBase.h>
#include <wtf/PassOwnPtr.h> #include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h> #include <wtf/RefPtr.h>
#include <wtf/Vector.h> #include <wtf/Vector.h>
#if ENABLE(JIT)
#include "StructureStubInfo.h"
#endif
// Register numbers used in bytecode operations have different meaning according to their ranges: // Register numbers used in bytecode operations have different meaning according to their ranges:
// 0x80000000-0xFFFFFFFF Negative indices from the CallFrame pointer are entries in the call frame, see RegisterFile.h. // 0x80000000-0xFFFFFFFF Negative indices from the CallFrame pointer are entries in the call frame, see RegisterFile.h.
// 0x00000000-0x3FFFFFFF Forwards indices from the CallFrame pointer are local vars and temporaries with the function's callframe. // 0x00000000-0x3FFFFFFF Forwards indices from the CallFrame pointer are local vars and temporaries with the function's callframe.
...@@ -68,6 +65,14 @@ namespace JSC { ...@@ -68,6 +65,14 @@ namespace JSC {
static ALWAYS_INLINE int missingThisObjectMarker() { return std::numeric_limits<int>::max(); } static ALWAYS_INLINE int missingThisObjectMarker() { return std::numeric_limits<int>::max(); }
struct HandlerInfo { struct HandlerInfo {
HandlerInfo(uint32_t start, uint32_t end, uint32_t target, uint32_t scopeDepth)
: start(start)
, end(end)
, target(target)
, scopeDepth(scopeDepth)
{
}
uint32_t start; uint32_t start;
uint32_t end; uint32_t end;
uint32_t target; uint32_t target;
...@@ -389,18 +394,17 @@ namespace JSC { ...@@ -389,18 +394,17 @@ namespace JSC {
void createActivation(CallFrame*); void createActivation(CallFrame*);
#if ENABLE(INTERPRETER) #if ENABLE(INTERPRETER)
void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); } void addPropertyAccessInfo(unsigned propertyAccessInstruction, AccessType) { m_propertyAccessInstructions.append(propertyAccessInstruction); }
void addGlobalResolveInstruction(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); } void addGlobalResolveInfo(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); }
bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset); void addCallLinkInfo() { }
#endif #endif
#if ENABLE(JIT) #if ENABLE(JIT)
size_t numberOfStructureStubInfos() const { return m_structureStubInfos.size(); } size_t numberOfStructureStubInfos() const { return m_structureStubInfos.size(); }
void addStructureStubInfo(const StructureStubInfo& stubInfo) { m_structureStubInfos.append(stubInfo); } void addPropertyAccessInfo(unsigned, AccessType accessType) { m_structureStubInfos.append(accessType); }
StructureStubInfo& structureStubInfo(int index) { return m_structureStubInfos[index]; } StructureStubInfo& structureStubInfo(int index) { return m_structureStubInfos[index]; }
void addGlobalResolveInfo(unsigned globalResolveInstruction) { m_globalResolveInfos.append(GlobalResolveInfo(globalResolveInstruction)); } void addGlobalResolveInfo(unsigned globalResolveInstruction) { m_globalResolveInfos.append(GlobalResolveInfo(globalResolveInstruction)); }
GlobalResolveInfo& globalResolveInfo(int index) { return m_globalResolveInfos[index]; } GlobalResolveInfo& globalResolveInfo(int index) { return m_globalResolveInfos[index]; }
bool hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset);
size_t numberOfCallLinkInfos() const { return m_callLinkInfos.size(); } size_t numberOfCallLinkInfos() const { return m_callLinkInfos.size(); }
void addCallLinkInfo() { m_callLinkInfos.append(CallLinkInfo()); } void addCallLinkInfo() { m_callLinkInfos.append(CallLinkInfo()); }
......
...@@ -270,6 +270,22 @@ namespace JSC { ...@@ -270,6 +270,22 @@ namespace JSC {
return 0; return 0;
} }
enum AccessType {
access_get_by_id_self,
access_get_by_id_proto,
access_get_by_id_chain,
access_get_by_id_self_list,
access_get_by_id_proto_list,
access_put_by_id_transition,
access_put_by_id_replace,
access_get_by_id,
access_put_by_id,
access_get_by_id_generic,
access_put_by_id_generic,
access_get_array_length,
access_get_string_length,
};
} // namespace JSC } // namespace JSC
#endif // Opcode_h #endif // Opcode_h
...@@ -35,22 +35,6 @@ ...@@ -35,22 +35,6 @@
namespace JSC { namespace JSC {
enum AccessType {
access_get_by_id_self,
access_get_by_id_proto,
access_get_by_id_chain,
access_get_by_id_self_list,
access_get_by_id_proto_list,
access_put_by_id_transition,
access_put_by_id_replace,
access_get_by_id,
access_put_by_id,
access_get_by_id_generic,
access_put_by_id_generic,
access_get_array_length,
access_get_string_length,
};
struct StructureStubInfo { struct StructureStubInfo {
StructureStubInfo(AccessType accessType) StructureStubInfo(AccessType accessType)
: accessType(accessType) : accessType(accessType)
......
...@@ -1201,11 +1201,8 @@ RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const Identifier& pr ...@@ -1201,11 +1201,8 @@ RegisterID* BytecodeGenerator::emitResolve(RegisterID* dst, const Identifier& pr
return emitGetScopedVar(dst, depth, index, globalObject); return emitGetScopedVar(dst, depth, index, globalObject);
} }
#if ENABLE(JIT)
m_codeBlock->addGlobalResolveInfo(instructions().size()); m_codeBlock->addGlobalResolveInfo(instructions().size());
#else
m_codeBlock->addGlobalResolveInstruction(instructions().size());
#endif
emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global); emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global);
instructions().append(dst->index()); instructions().append(dst->index());
instructions().append(addConstant(property)); instructions().append(addConstant(property));
...@@ -1341,11 +1338,8 @@ RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, Register ...@@ -1341,11 +1338,8 @@ RegisterID* BytecodeGenerator::emitResolveWithBase(RegisterID* baseDst, Register
return baseDst; return baseDst;
} }
#if ENABLE(JIT)
m_codeBlock->addGlobalResolveInfo(instructions().size()); m_codeBlock->addGlobalResolveInfo(instructions().size());
#else
m_codeBlock->addGlobalResolveInstruction(instructions().size());
#endif
emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global); emitOpcode(requiresDynamicChecks ? op_resolve_global_dynamic : op_resolve_global);
instructions().append(propDst->index()); instructions().append(propDst->index());
instructions().append(addConstant(property)); instructions().append(addConstant(property));
...@@ -1363,11 +1357,7 @@ void BytecodeGenerator::emitMethodCheck() ...@@ -1363,11 +1357,7 @@ void BytecodeGenerator::emitMethodCheck()
RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property) RegisterID* BytecodeGenerator::emitGetById(RegisterID* dst, RegisterID* base, const Identifier& property)
{ {
#if ENABLE(JIT) m_codeBlock->addPropertyAccessInfo(instructions().size(), access_get_by_id);
m_codeBlock->addStructureStubInfo(StructureStubInfo(access_get_by_id));
#else
m_codeBlock->addPropertyAccessInstruction(instructions().size());
#endif
emitOpcode(op_get_by_id); emitOpcode(op_get_by_id);
instructions().append(dst->index()); instructions().append(dst->index());
...@@ -1392,11 +1382,7 @@ RegisterID* BytecodeGenerator::emitGetArgumentsLength(RegisterID* dst, RegisterI ...@@ -1392,11 +1382,7 @@ RegisterID* BytecodeGenerator::emitGetArgumentsLength(RegisterID* dst, RegisterI
RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value) RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& property, RegisterID* value)
{ {
#if ENABLE(JIT) m_codeBlock->addPropertyAccessInfo(instructions().size(), access_put_by_id);
m_codeBlock->addStructureStubInfo(StructureStubInfo(access_put_by_id));
#else
m_codeBlock->addPropertyAccessInstruction(instructions().size());
#endif
emitOpcode(op_put_by_id); emitOpcode(op_put_by_id);
instructions().append(base->index()); instructions().append(base->index());
...@@ -1412,11 +1398,7 @@ RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& p ...@@ -1412,11 +1398,7 @@ RegisterID* BytecodeGenerator::emitPutById(RegisterID* base, const Identifier& p
RegisterID* BytecodeGenerator::emitDirectPutById(RegisterID* base, const Identifier& property, RegisterID* value) RegisterID* BytecodeGenerator::emitDirectPutById(RegisterID* base, const Identifier& property, RegisterID* value)
{ {
#if ENABLE(JIT) m_codeBlock->addPropertyAccessInfo(instructions().size(), access_put_by_id);
m_codeBlock->addStructureStubInfo(StructureStubInfo(access_put_by_id));
#else
m_codeBlock->addPropertyAccessInstruction(instructions().size());
#endif
emitOpcode(op_put_by_id); emitOpcode(op_put_by_id);
instructions().append(base->index()); instructions().append(base->index());
...@@ -1647,9 +1629,7 @@ RegisterID* BytecodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, Regi ...@@ -1647,9 +1629,7 @@ RegisterID* BytecodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, Regi
emitExpressionInfo(divot, startOffset, endOffset); emitExpressionInfo(divot, startOffset, endOffset);
#if ENABLE(JIT)
m_codeBlock->addCallLinkInfo(); m_codeBlock->addCallLinkInfo();
#endif
// Emit call. // Emit call.
emitOpcode(opcodeID); emitOpcode(opcodeID);
...@@ -1764,9 +1744,7 @@ RegisterID* BytecodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func, ...@@ -1764,9 +1744,7 @@ RegisterID* BytecodeGenerator::emitConstruct(RegisterID* dst, RegisterID* func,
emitExpressionInfo(divot, startOffset, endOffset); emitExpressionInfo(divot, startOffset, endOffset);
#if ENABLE(JIT)
m_codeBlock->addCallLinkInfo(); m_codeBlock->addCallLinkInfo();
#endif
emitOpcode(op_construct); emitOpcode(op_construct);
instructions().append(func->index()); // func instructions().append(func->index()); // func
...@@ -2029,11 +2007,7 @@ RegisterID* BytecodeGenerator::emitNextPropertyName(RegisterID* dst, RegisterID* ...@@ -2029,11 +2007,7 @@ RegisterID* BytecodeGenerator::emitNextPropertyName(RegisterID* dst, RegisterID*
RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end) RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end)
{ {
m_usesExceptions = true; m_usesExceptions = true;
#if ENABLE(JIT) HandlerInfo info = HandlerInfo(start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth);
HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() };
#else
HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth };
#endif
m_codeBlock->addExceptionHandler(info); m_codeBlock->addExceptionHandler(info);
emitOpcode(op_catch); emitOpcode(op_catch);
......
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