summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/GetByIdStatus.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-20 13:01:08 +0200
commit49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch)
tree5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/JavaScriptCore/bytecode/GetByIdStatus.h
parentb211c645d8ab690f713515dfdc84d80b11c27d2c (diff)
downloadqtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/JavaScriptCore/bytecode/GetByIdStatus.h')
-rw-r--r--Source/JavaScriptCore/bytecode/GetByIdStatus.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.h b/Source/JavaScriptCore/bytecode/GetByIdStatus.h
index 39476c009..42eadfd68 100644
--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.h
+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.h
@@ -38,7 +38,8 @@ class GetByIdStatus {
public:
enum State {
NoInformation, // It's uncached so we have no information.
- SimpleDirect, // It's cached for a direct access to a known object property.
+ Simple, // It's cached for a simple access to a known object property with
+ // a possible structure chain and a possible specific value.
TakesSlowPath, // It's known to often take slow path.
MakesCalls // It's known to take paths that make calls.
};
@@ -49,13 +50,17 @@ public:
{
}
- GetByIdStatus(State state, const StructureSet& structureSet, size_t offset, bool wasSeenInJIT)
+ GetByIdStatus(
+ State state, bool wasSeenInJIT, const StructureSet& structureSet = StructureSet(),
+ size_t offset = notFound, JSValue specificValue = JSValue(), Vector<Structure*> chain = Vector<Structure*>())
: m_state(state)
, m_structureSet(structureSet)
+ , m_chain(chain)
+ , m_specificValue(specificValue)
, m_offset(offset)
, m_wasSeenInJIT(wasSeenInJIT)
{
- ASSERT((state == SimpleDirect) == (offset != notFound));
+ ASSERT((state == Simple) == (offset != notFound));
}
static GetByIdStatus computeFor(CodeBlock*, unsigned bytecodeIndex, Identifier&);
@@ -64,20 +69,25 @@ public:
bool isSet() const { return m_state != NoInformation; }
bool operator!() const { return !isSet(); }
- bool isSimpleDirect() const { return m_state == SimpleDirect; }
+ bool isSimple() const { return m_state == Simple; }
bool takesSlowPath() const { return m_state == TakesSlowPath || m_state == MakesCalls; }
bool makesCalls() const { return m_state == MakesCalls; }
const StructureSet& structureSet() const { return m_structureSet; }
+ const Vector<Structure*>& chain() const { return m_chain; } // Returns empty vector if this is a direct access.
+ JSValue specificValue() const { return m_specificValue; } // Returns JSValue() if there is no specific value.
size_t offset() const { return m_offset; }
bool wasSeenInJIT() const { return m_wasSeenInJIT; }
private:
+ static void computeForChain(GetByIdStatus& result, CodeBlock*, Identifier&, Structure*);
static GetByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, Identifier&);
State m_state;
StructureSet m_structureSet;
+ Vector<Structure*> m_chain;
+ JSValue m_specificValue;
size_t m_offset;
bool m_wasSeenInJIT;
};