(path: ObjectPath)
| 222 | |
| 223 | // Assumption: If only a specific path is deoptimized, no accessors are created |
| 224 | deoptimizePath(path: ObjectPath): void { |
| 225 | if (this.hasLostTrack || this.immutable) { |
| 226 | return; |
| 227 | } |
| 228 | const key = path[0]; |
| 229 | if (path.length === 1) { |
| 230 | if (key === UnknownInteger) { |
| 231 | return this.deoptimizeIntegerProperties(); |
| 232 | } else if (!isConcreteKey(key)) { |
| 233 | return this.deoptimizeAllProperties(key === UnknownNonAccessorKey); |
| 234 | } |
| 235 | if (!this.deoptimizedPaths.get(key)) { |
| 236 | this.deoptimizedPaths.set(key, true); |
| 237 | |
| 238 | // we only deoptimizeCache exact matches as in all other cases, |
| 239 | // we do not return a literal value or return expression |
| 240 | const expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey.get(key); |
| 241 | if (expressionsToBeDeoptimized) { |
| 242 | for (const expression of expressionsToBeDeoptimized) { |
| 243 | expression.deoptimizeCache(); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1); |
| 250 | for (const property of isConcreteKey(key) |
| 251 | ? [ |
| 252 | ...(this.propertiesAndGettersByKey.get(key) || this.unmatchablePropertiesAndGetters), |
| 253 | ...(this.settersByKey.get(key) || this.unmatchableSetters) |
| 254 | ] |
| 255 | : this.allProperties) { |
| 256 | property.deoptimizePath(subPath); |
| 257 | } |
| 258 | this.prototypeExpression?.deoptimizePath(path.length === 1 ? [path[0], UnknownKey] : path); |
| 259 | } |
| 260 | |
| 261 | getLiteralValueAtPath( |
| 262 | path: ObjectPath, |
nothing calls this directly
no test coverage detected