Skip to content

Commit 7b377eb

Browse files
committed
Prototype assumption is trivially always valid for %Object.prototype%.
1 parent 45e09c7 commit 7b377eb

File tree

1 file changed

+7
-0
lines changed
  • graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/objects

1 file changed

+7
-0
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/objects/JSShape.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ public static JSContext getJSContext(Shape shape) {
192192
return getSharedData(shape).getContext();
193193
}
194194

195+
public static boolean isObjectPrototype(Shape shape) {
196+
return getJSClassNoCast(shape) == JSObjectPrototype.INSTANCE;
197+
}
198+
195199
public static Assumption getPrototypeAssumption(Shape shape) {
200+
if (isObjectPrototype(shape)) {
201+
return Assumption.ALWAYS_VALID;
202+
}
196203
return getSharedData(shape).getPrototypeAssumption();
197204
}
198205

0 commit comments

Comments
 (0)