/*
- * 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
codeBlock->vm()->heap.addReference(neuteringWatchpoint, view->buffer());
}
+void InferredValueAdaptor::add(
+ CodeBlock* codeBlock, InferredValue* inferredValue, Watchpoint* watchpoint)
+{
+ codeBlock->addConstant(inferredValue); // For common users, it doesn't really matter if it's weak or not. If references to it go away, we go away, too.
+ inferredValue->add(watchpoint);
+}
+
DesiredWatchpoints::DesiredWatchpoints() { }
DesiredWatchpoints::~DesiredWatchpoints() { }
m_inlineSets.addLazily(&set);
}
-void DesiredWatchpoints::addLazily(JSArrayBufferView* view)
+void DesiredWatchpoints::addLazily(InferredValue* inferredValue)
{
- m_bufferViews.addLazily(view);
+ m_inferredValues.addLazily(inferredValue);
}
-void DesiredWatchpoints::addLazily(CodeOrigin codeOrigin, ExitKind exitKind, WatchpointSet* set)
+void DesiredWatchpoints::addLazily(JSArrayBufferView* view)
{
- m_sets.addLazily(codeOrigin, exitKind, set);
+ m_bufferViews.addLazily(view);
}
-void DesiredWatchpoints::addLazily(CodeOrigin codeOrigin, ExitKind exitKind, InlineWatchpointSet& set)
+bool DesiredWatchpoints::consider(Structure* structure)
{
- m_inlineSets.addLazily(codeOrigin, exitKind, &set);
+ if (!structure->dfgShouldWatch())
+ return false;
+ addLazily(structure->transitionWatchpointSet());
+ return true;
}
void DesiredWatchpoints::reallyAdd(CodeBlock* codeBlock, CommonData& commonData)
{
m_sets.reallyAdd(codeBlock, commonData);
m_inlineSets.reallyAdd(codeBlock, commonData);
+ m_inferredValues.reallyAdd(codeBlock, commonData);
m_bufferViews.reallyAdd(codeBlock, commonData);
}
{
return m_sets.areStillValid()
&& m_inlineSets.areStillValid()
+ && m_inferredValues.areStillValid()
&& m_bufferViews.areStillValid();
}