summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-14 16:29:47 +0200
commitd0424a769059c84ae20beb3c217812792ea6726b (patch)
tree6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
parent88a04ac016f57c2d78e714682445dff2e7db4ade (diff)
downloadqtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp53
1 files changed, 29 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 201c42e71..f8ef37b03 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -193,7 +193,7 @@ private:
NodeIndex getLocal(unsigned operand)
{
NodeIndex nodeIndex = m_currentBlock->variablesAtTail.local(operand);
- bool isCaptured = m_codeBlock->localIsCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
if (nodeIndex != NoNode) {
Node* nodePtr = &m_graph[nodeIndex];
@@ -253,7 +253,7 @@ private:
}
void setLocal(unsigned operand, NodeIndex value, SetMode setMode = NormalSet)
{
- bool isCaptured = m_codeBlock->localIsCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
if (setMode == NormalSet) {
ArgumentPosition* argumentPosition = findArgumentPositionForLocal(operand);
@@ -272,12 +272,10 @@ private:
NodeIndex getArgument(unsigned operand)
{
unsigned argument = operandToArgument(operand);
-
- bool isCaptured = m_codeBlock->argumentIsCaptured(argument);
-
ASSERT(argument < m_numArguments);
NodeIndex nodeIndex = m_currentBlock->variablesAtTail.argument(argument);
+ bool isCaptured = m_codeBlock->isCaptured(operand);
if (nodeIndex != NoNode) {
Node* nodePtr = &m_graph[nodeIndex];
@@ -339,10 +337,10 @@ private:
void setArgument(int operand, NodeIndex value, SetMode setMode = NormalSet)
{
unsigned argument = operandToArgument(operand);
- bool isCaptured = m_codeBlock->argumentIsCaptured(argument);
-
ASSERT(argument < m_numArguments);
+ bool isCaptured = m_codeBlock->isCaptured(operand);
+
// Always flush arguments, except for 'this'.
if (argument && setMode == NormalSet)
flushDirect(operand);
@@ -402,7 +400,7 @@ private:
// FIXME: This should check if the same operand had already been flushed to
// some other local variable.
- bool isCaptured = m_codeBlock->isCaptured(m_inlineStackTop->m_inlineCallFrame, operand);
+ bool isCaptured = m_codeBlock->isCaptured(operand, m_inlineStackTop->m_inlineCallFrame);
ASSERT(operand < FirstConstantRegisterIndex);
@@ -1685,7 +1683,7 @@ void ByteCodeParser::handleGetByOffset(
if (isInlineOffset(offset))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
set(destinationOperand,
addToGraph(
GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction),
@@ -1773,7 +1771,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
m_graph.m_arguments.resize(m_numArguments);
for (unsigned argument = 0; argument < m_numArguments; ++argument) {
VariableAccessData* variable = newVariableAccessData(
- argumentToOperand(argument), m_codeBlock->argumentIsCaptured(argument));
+ argumentToOperand(argument), m_codeBlock->isCaptured(argumentToOperand(argument)));
variable->mergeStructureCheckHoistingFailed(
m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache));
NodeIndex setArgument = addToGraph(SetArgument, OpInfo(variable));
@@ -2276,7 +2274,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_put_scoped_var);
}
case op_get_by_id:
- case op_get_by_id_out_of_line: {
+ case op_get_by_id_out_of_line:
+ case op_get_array_length: {
SpeculatedType prediction = getPrediction();
NodeIndex base = get(currentInstruction[2].u.operand);
@@ -2317,7 +2316,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
if (isInlineOffset(putByIdStatus.offset()))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), propertyStorage, base, value);
StorageAccessData storageAccessData;
@@ -2368,13 +2367,13 @@ bool ByteCodeParser::parseBlock(unsigned limit)
} else {
propertyStorage = addToGraph(
ReallocatePropertyStorage, OpInfo(transitionData),
- base, addToGraph(GetPropertyStorage, base));
+ base, addToGraph(GetButterfly, base));
}
} else {
if (isInlineOffset(putByIdStatus.offset()))
propertyStorage = base;
else
- propertyStorage = addToGraph(GetPropertyStorage, base);
+ propertyStorage = addToGraph(GetButterfly, base);
}
addToGraph(PutStructure, OpInfo(transitionData), base);
@@ -2458,7 +2457,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_get_global_var_watchable);
}
- case op_put_global_var: {
+ case op_put_global_var:
+ case op_init_global_const: {
NodeIndex value = get(currentInstruction[2].u.operand);
addToGraph(
PutGlobalVar,
@@ -2467,7 +2467,8 @@ bool ByteCodeParser::parseBlock(unsigned limit)
NEXT_OPCODE(op_put_global_var);
}
- case op_put_global_var_check: {
+ case op_put_global_var_check:
+ case op_init_global_const_check: {
NodeIndex value = get(currentInstruction[2].u.operand);
CodeBlock* codeBlock = m_inlineStackTop->m_codeBlock;
JSGlobalObject* globalObject = codeBlock->globalObject();
@@ -3187,17 +3188,21 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(
if (inlineCallFrame.caller.inlineCallFrame)
inlineCallFrame.capturedVars = inlineCallFrame.caller.inlineCallFrame->capturedVars;
else {
- for (int i = byteCodeParser->m_codeBlock->m_numCapturedVars; i--;)
- inlineCallFrame.capturedVars.set(i);
+ for (int i = byteCodeParser->m_codeBlock->m_numVars; i--;) {
+ if (byteCodeParser->m_codeBlock->isCaptured(i))
+ inlineCallFrame.capturedVars.set(i);
+ }
}
-
- if (codeBlock->argumentsAreCaptured()) {
- for (int i = argumentCountIncludingThis; i--;)
+
+ for (int i = argumentCountIncludingThis; i--;) {
+ if (codeBlock->isCaptured(argumentToOperand(i)))
inlineCallFrame.capturedVars.set(argumentToOperand(i) + inlineCallFrame.stackOffset);
}
- for (int i = codeBlock->m_numCapturedVars; i--;)
- inlineCallFrame.capturedVars.set(i + inlineCallFrame.stackOffset);
-
+ for (size_t i = codeBlock->m_numVars; i--;) {
+ if (codeBlock->isCaptured(i))
+ inlineCallFrame.capturedVars.set(i + inlineCallFrame.stackOffset);
+ }
+
#if DFG_ENABLE(DEBUG_VERBOSE)
dataLog("Current captured variables: ");
inlineCallFrame.capturedVars.dump(WTF::dataFile());