summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGBasicBlock.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGBasicBlock.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp b/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
index 07a972633..383ee4b9a 100644
--- a/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
+++ b/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,11 +28,12 @@
#if ENABLE(DFG_JIT)
-#include "Operations.h"
+#include "JSCInlines.h"
namespace JSC { namespace DFG {
-BasicBlock::BasicBlock(unsigned bytecodeBegin, unsigned numArguments, unsigned numLocals)
+BasicBlock::BasicBlock(
+ unsigned bytecodeBegin, unsigned numArguments, unsigned numLocals, float executionCount)
: bytecodeBegin(bytecodeBegin)
, index(NoBlock)
, isOSRTarget(false)
@@ -40,6 +41,8 @@ BasicBlock::BasicBlock(unsigned bytecodeBegin, unsigned numArguments, unsigned n
, cfaShouldRevisit(false)
, cfaFoundConstants(false)
, cfaDidFinish(true)
+ , cfaStructureClobberStateAtHead(StructuresAreWatched)
+ , cfaStructureClobberStateAtTail(StructuresAreWatched)
, cfaBranchDirection(InvalidBranchDirection)
#if !ASSERT_DISABLED
, isLinked(false)
@@ -49,10 +52,15 @@ BasicBlock::BasicBlock(unsigned bytecodeBegin, unsigned numArguments, unsigned n
, variablesAtTail(numArguments, numLocals)
, valuesAtHead(numArguments, numLocals)
, valuesAtTail(numArguments, numLocals)
+ , intersectionOfPastValuesAtHead(numArguments, numLocals, AbstractValue::fullTop())
+ , intersectionOfCFAHasVisited(true)
+ , executionCount(executionCount)
{
}
-BasicBlock::~BasicBlock() { }
+BasicBlock::~BasicBlock()
+{
+}
void BasicBlock::ensureLocals(unsigned newNumLocals)
{
@@ -60,6 +68,20 @@ void BasicBlock::ensureLocals(unsigned newNumLocals)
variablesAtTail.ensureLocals(newNumLocals);
valuesAtHead.ensureLocals(newNumLocals);
valuesAtTail.ensureLocals(newNumLocals);
+ intersectionOfPastValuesAtHead.ensureLocals(newNumLocals, AbstractValue::fullTop());
+}
+
+void BasicBlock::replaceTerminal(Node* node)
+{
+ NodeAndIndex result = findTerminal();
+ if (!result)
+ append(node);
+ else {
+ m_nodes.insert(result.index + 1, node);
+ result.node->remove();
+ }
+
+ ASSERT(terminal());
}
bool BasicBlock::isInPhis(Node* node) const
@@ -109,11 +131,9 @@ void BasicBlock::dump(PrintStream& out) const
}
BasicBlock::SSAData::SSAData(BasicBlock* block)
- : flushAtHead(OperandsLike, block->variablesAtHead)
- , flushAtTail(OperandsLike, block->variablesAtHead)
- , availabilityAtHead(OperandsLike, block->variablesAtHead)
- , availabilityAtTail(OperandsLike, block->variablesAtHead)
{
+ availabilityAtHead.m_locals = Operands<Availability>(OperandsLike, block->variablesAtHead);
+ availabilityAtTail.m_locals = Operands<Availability>(OperandsLike, block->variablesAtHead);
}
BasicBlock::SSAData::~SSAData() { }