summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/CodeBlock.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/CodeBlock.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/CodeBlock.h')
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h55
1 files changed, 39 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index cdc6a19e8..573d422d3 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
* Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca>
*
* Redistribution and use in source and binary forms, with or without
@@ -62,6 +62,7 @@
#include "UString.h"
#include "UnconditionalFinalizer.h"
#include "ValueProfile.h"
+#include "Watchpoint.h"
#include <wtf/RefCountedArray.h>
#include <wtf/FastAllocBase.h>
#include <wtf/PassOwnPtr.h>
@@ -273,10 +274,12 @@ namespace JSC {
return result;
}
- void appendOSRExit(const DFG::OSRExit& osrExit)
+ unsigned appendOSRExit(const DFG::OSRExit& osrExit)
{
createDFGDataIfNecessary();
+ unsigned result = m_dfgData->osrExit.size();
m_dfgData->osrExit.append(osrExit);
+ return result;
}
DFG::OSRExit& lastOSRExit()
@@ -284,10 +287,20 @@ namespace JSC {
return m_dfgData->osrExit.last();
}
- void appendSpeculationRecovery(const DFG::SpeculationRecovery& recovery)
+ unsigned appendSpeculationRecovery(const DFG::SpeculationRecovery& recovery)
{
createDFGDataIfNecessary();
+ unsigned result = m_dfgData->speculationRecovery.size();
m_dfgData->speculationRecovery.append(recovery);
+ return result;
+ }
+
+ unsigned appendWatchpoint(const Watchpoint& watchpoint)
+ {
+ createDFGDataIfNecessary();
+ unsigned result = m_dfgData->watchpoints.size();
+ m_dfgData->watchpoints.append(watchpoint);
+ return result;
}
unsigned numberOfOSRExits()
@@ -304,6 +317,13 @@ namespace JSC {
return m_dfgData->speculationRecovery.size();
}
+ unsigned numberOfWatchpoints()
+ {
+ if (!m_dfgData)
+ return 0;
+ return m_dfgData->watchpoints.size();
+ }
+
DFG::OSRExit& osrExit(unsigned index)
{
return m_dfgData->osrExit[index];
@@ -314,6 +334,11 @@ namespace JSC {
return m_dfgData->speculationRecovery[index];
}
+ Watchpoint& watchpoint(unsigned index)
+ {
+ return m_dfgData->watchpoints[index];
+ }
+
void appendWeakReference(JSCell* target)
{
createDFGDataIfNecessary();
@@ -576,7 +601,7 @@ namespace JSC {
bytecodeOffset].u.opcode)) - 1].u.profile == result);
return result;
}
- PredictedType valueProfilePredictionForBytecodeOffset(int bytecodeOffset)
+ SpeculatedType valueProfilePredictionForBytecodeOffset(int bytecodeOffset)
{
return valueProfileForBytecodeOffset(bytecodeOffset)->computeUpdatedPrediction();
}
@@ -686,8 +711,7 @@ namespace JSC {
void addLineInfo(unsigned bytecodeOffset, int lineNo)
{
- createRareDataIfNecessary();
- Vector<LineInfo>& lineInfo = m_rareData->m_lineInfo;
+ Vector<LineInfo>& lineInfo = m_lineInfo;
if (!lineInfo.size() || lineInfo.last().lineNumber != lineNo) {
LineInfo info = { bytecodeOffset, lineNo };
lineInfo.append(info);
@@ -695,14 +719,6 @@ namespace JSC {
}
bool hasExpressionInfo() { return m_rareData && m_rareData->m_expressionInfo.size(); }
- bool hasLineInfo() { return m_rareData && m_rareData->m_lineInfo.size(); }
- // We only generate exception handling info if the user is debugging
- // (and may want line number info), or if the function contains exception handler.
- bool needsCallReturnIndices()
- {
- return m_rareData &&
- (m_rareData->m_expressionInfo.size() || m_rareData->m_lineInfo.size() || m_rareData->m_exceptionHandlers.size());
- }
#if ENABLE(JIT)
Vector<CallReturnOffsetToBytecodeOffset>& callReturnIndexVector()
@@ -1238,6 +1254,7 @@ namespace JSC {
Vector<DFG::OSREntryData> osrEntry;
SegmentedVector<DFG::OSRExit, 8> osrExit;
Vector<DFG::SpeculationRecovery> speculationRecovery;
+ SegmentedVector<Watchpoint, 1, 0> watchpoints;
Vector<WeakReferenceTransition> transitions;
Vector<WriteBarrier<JSCell> > weakReferences;
bool mayBeExecuting;
@@ -1285,7 +1302,9 @@ namespace JSC {
uint32_t m_forcedOSRExitCounter;
uint16_t m_optimizationDelayCounter;
uint16_t m_reoptimizationRetryCounter;
-
+
+ Vector<LineInfo> m_lineInfo;
+
struct RareData {
WTF_MAKE_FAST_ALLOCATED;
public:
@@ -1307,7 +1326,6 @@ namespace JSC {
// Expression info - present if debugging.
Vector<ExpressionRangeInfo> m_expressionInfo;
// Line info - present if profiling or debugging.
- Vector<LineInfo> m_lineInfo;
#if ENABLE(JIT)
Vector<CallReturnOffsetToBytecodeOffset> m_callReturnIndexVector;
#endif
@@ -1499,6 +1517,11 @@ namespace JSC {
}
#endif
+ inline JSValue Structure::prototypeForLookup(CodeBlock* codeBlock) const
+ {
+ return prototypeForLookup(codeBlock->globalObject());
+ }
+
} // namespace JSC
#endif // CodeBlock_h