Skip to content
Permalink
Browse files
[JSC] Use m_structureCacheClearedWatchpoint in more DFG nodes
https://bugs.webkit.org/show_bug.cgi?id=241575

Reviewed by Yusuke Suzuki.

Not sure if this is observable, but it's worth to align with ObjectCreate for consistency.

* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::handleCreateInternalFieldObject):
* Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):

Canonical link: https://commits.webkit.org/251719@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
shvaikalesh committed Jun 22, 2022
1 parent d1a65d4 commit 6d01e0a7489caa6e42fbe2bd56420916a1e24e00
Showing 3 changed files with 12 additions and 9 deletions.
@@ -3017,7 +3017,8 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
if (JSValue base = forNode(node->child1()).m_value) {
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
if (Structure* structure = rareData->objectAllocationStructure()) {
m_graph.freeze(rareData);
m_graph.watchpoints().addLazily(rareData->allocationProfileWatchpointSet());
@@ -3046,7 +3047,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
}
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == (node->isInternalPromise() ? JSInternalPromise::info() : JSPromise::info())
@@ -3074,7 +3075,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
if (JSValue base = forNode(node->child1()).m_value) {
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == classInfo
@@ -5556,7 +5556,8 @@ void ByteCodeParser::parseBlock(unsigned limit)
bool alreadyEmitted = false;
if (function) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
JSGlobalObject* globalObject = m_graph.globalObjectFor(currentNodeOrigin().semantic);
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->objectAllocationStructure();
JSObject* prototype = rareData->objectAllocationPrototype();
if (structure
@@ -5637,7 +5638,7 @@ void ByteCodeParser::parseBlock(unsigned limit)

if (function) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == (bytecode.m_isInternalPromise ? JSInternalPromise::info() : JSPromise::info())
@@ -9019,7 +9020,7 @@ void ByteCodeParser::handleCreateInternalFieldObject(const ClassInfo* classInfo,

if (function) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == classInfo
@@ -732,7 +732,8 @@ class ConstantFoldingPhase : public Phase {
if (JSValue base = m_state.forNode(node->child1()).m_value) {
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->objectAllocationStructure();
JSObject* prototype = rareData->objectAllocationPrototype();
if (structure
@@ -774,7 +775,7 @@ class ConstantFoldingPhase : public Phase {
}
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == (node->isInternalPromise() ? JSInternalPromise::info() : JSPromise::info())
@@ -799,7 +800,7 @@ class ConstantFoldingPhase : public Phase {
if (JSValue base = m_state.forNode(node->child1()).m_value) {
if (auto* function = jsDynamicCast<JSFunction*>(base)) {
if (FunctionRareData* rareData = function->rareData()) {
if (rareData->allocationProfileWatchpointSet().isStillValid()) {
if (rareData->allocationProfileWatchpointSet().isStillValid() && m_graph.isWatchingStructureCacheClearedWatchpoint(globalObject)) {
Structure* structure = rareData->internalFunctionAllocationStructure();
if (structure
&& structure->classInfoForCells() == classInfo

0 comments on commit 6d01e0a

Please sign in to comment.