diff options
Diffstat (limited to 'Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h b/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h index bd7d3ae9b..736ba8540 100644 --- a/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h +++ b/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. + * Copyright (C) 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 @@ -36,13 +36,11 @@ namespace JSC { class CodeBlock; -class BytecodeBasicBlock { - WTF_MAKE_FAST_ALLOCATED; +class BytecodeBasicBlock : public RefCounted<BytecodeBasicBlock> { public: enum SpecialBlockType { EntryBlock, ExitBlock }; BytecodeBasicBlock(unsigned start, unsigned length); BytecodeBasicBlock(SpecialBlockType); - void shrinkToFit(); bool isEntryBlock() { return !m_leaderBytecodeOffset && !m_totalBytecodeLength; } bool isExitBlock() { return m_leaderBytecodeOffset == UINT_MAX && m_totalBytecodeLength == UINT_MAX; } @@ -53,9 +51,12 @@ public: Vector<unsigned>& bytecodeOffsets() { return m_bytecodeOffsets; } void addBytecodeLength(unsigned); - Vector<BytecodeBasicBlock*>& successors() { return m_successors; } + void addPredecessor(BytecodeBasicBlock* block) { m_predecessors.append(block); } void addSuccessor(BytecodeBasicBlock* block) { m_successors.append(block); } + Vector<BytecodeBasicBlock*>& predecessors() { return m_predecessors; } + Vector<BytecodeBasicBlock*>& successors() { return m_successors; } + FastBitVector& in() { return m_in; } FastBitVector& out() { return m_out; } @@ -64,13 +65,15 @@ private: unsigned m_totalBytecodeLength; Vector<unsigned> m_bytecodeOffsets; + + Vector<BytecodeBasicBlock*> m_predecessors; Vector<BytecodeBasicBlock*> m_successors; FastBitVector m_in; FastBitVector m_out; }; -void computeBytecodeBasicBlocks(CodeBlock*, Vector<std::unique_ptr<BytecodeBasicBlock>>&); +void computeBytecodeBasicBlocks(CodeBlock*, Vector<RefPtr<BytecodeBasicBlock> >&); inline BytecodeBasicBlock::BytecodeBasicBlock(unsigned start, unsigned length) : m_leaderBytecodeOffset(start) |