3096 llintOp(op_enumerator_next, OpEnumeratorNext, macro (size, get, dispatch)
3097 # Note: this will always call the slow path on at least the first/last execution of EnumeratorNext for any given loop.
3098 # The upside this is that we don't have to record any metadata or mode information here as the slow path will do it for us when transitioning from InitMode/IndexedMode to OwnStructureMode, or from OwnStructureMode to GenericMode.
3099 get(m_mode, t0)
3100 bbneq t0, constexpr JSPropertyNameEnumerator::OwnStructureMode, .nextSlowPath
3101
3102 get(m_base, t1)
3103 loadConstantOrVariableCell(size, t1, t0, .nextSlowPath)
3104
3105 loadVariable(get, m_enumerator, t1)
3106 loadi JSPropertyNameEnumerator::m_cachedStructureID[t1], t2
3107 bineq t2, JSCell::m_structureID[t0], .nextSlowPath
3108
3109 loadVariable(get, m_index, t2)
3110 addq 1, t2
3111 loadi JSPropertyNameEnumerator::m_endStructurePropertyIndex, t3
3112 biaeq t2, t3, .nextSlowPath
3113
3114 storeVariable(get, m_index, t2, t3)
3115 loadp JSPropertyNameEnumerator::m_propertyNames[t1], t3
3116 zxi2q t2, t2
3117 loadp [t3, t2, PtrSize], t3
3118
3119 storeVariable(get, m_propertyName, t3, t2)
3120 dispatch()
3121
3122 .nextSlowPath:
3123 callSlowPath(_slow_path_enumerator_next)
3124 dispatch()
3125 end)
3126
3127 llintOpWithMetadata(op_enumerator_get_by_val, OpEnumeratorGetByVal, macro (size, get, dispatch, metadata, return)
3128 metadata(t5, t0)
3129
3130 loadVariable(get, m_mode, t0)
3131
3132 # FIXME: This should be orb but that doesn't exist for some reason... https://bugs.webkit.org/show_bug.cgi?id=229445
3133 loadb OpEnumeratorGetByVal::Metadata::m_enumeratorMetadata[t5], t1
3134 ori t0, t1
3135 storeb t1, OpEnumeratorGetByVal::Metadata::m_enumeratorMetadata[t5]
3136
3137 bbneq t0, constexpr JSPropertyNameEnumerator::OwnStructureMode, .getSlowPath
3138
3139 get(m_base, t1)
3140 loadConstantOrVariableCell(size, t1, t0, .getSlowPath)
3141
3142 loadVariable(get, m_enumerator, t1)
3143 loadi JSPropertyNameEnumerator::m_cachedStructureID[t1], t2
3144 bineq t2, JSCell::m_structureID[t0], .getSlowPath
3145
3146 loadVariable(get, m_index, t2)
3147 loadi JSPropertyNameEnumerator::m_cachedInlineCapacity[t1], t1
3148 biaeq t2, t1, .outOfLine
3149
3150 zxi2q t2, t2
3151 loadq sizeof JSObject[t0, t2, 8], t2
3152 jmp .done
3153
3154 .outOfLine:
3155 loadp JSObject::m_butterfly[t0], t0
3156 subi t1, t2
3157 negi t2
3158 sxi2q t2, t2
3159 loadq constexpr ((offsetInButterfly(firstOutOfLineOffset)) * sizeof(EncodedJSValue))[t0, t2, 8], t2
3160
3161 .done:
3162 valueProfile(OpEnumeratorGetByVal, m_profile, t5, t2)
3163 return(t2)
3164
3165 .getSlowPath:
3166 callSlowPath(_slow_path_enumerator_get_by_val)
3167 dispatch()
3168 end)
3169
3170 macro hasPropertyImpl(opcodeStruct, size, get, dispatch, metadata, return, slowPath)
3171 metadata(t5, t0)
3172
3173 loadVariable(get, m_mode, t0)
3174 # FIXME: This should be orb but that doesn't exist for some reason... https://bugs.webkit.org/show_bug.cgi?id=229445
3175 loadb %opcodeStruct%::Metadata::m_enumeratorMetadata[t5], t1
3176 ori t0, t1
3177 storeb t1, %opcodeStruct%::Metadata::m_enumeratorMetadata[t5]
3178
3179 bbneq t0, constexpr JSPropertyNameEnumerator::OwnStructureMode, .callSlowPath
3180
3181 get(m_base, t1)
3182 loadConstantOrVariableCell(size, t1, t0, .callSlowPath)
3183
3184 loadVariable(get, m_enumerator, t1)
3185 loadi JSPropertyNameEnumerator::m_cachedStructureID[t1], t2
3186 bineq t2, JSCell::m_structureID[t0], .callSlowPath
3187
3188 move ValueTrue, t2
3189 return(t2)
3190
3191 .callSlowPath:
3192 callSlowPath(slowPath)
3193 dispatch()
3194 end
3195
3196 llintOpWithMetadata(op_enumerator_in_by_val, OpEnumeratorInByVal, macro (size, get, dispatch, metadata, return)
3197 hasPropertyImpl(OpEnumeratorInByVal, size, get, dispatch, metadata, return, _slow_path_enumerator_in_by_val)
3198 end)
3199
3200 llintOpWithMetadata(op_enumerator_has_own_property, OpEnumeratorHasOwnProperty, macro (size, get, dispatch, metadata, return)
3201 hasPropertyImpl(OpEnumeratorHasOwnProperty, size, get, dispatch, metadata, return, _slow_path_enumerator_has_own_property)
3202 end)