summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h')
-rw-r--r--Source/JavaScriptCore/bytecode/BytecodeBasicBlock.h15
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)