Beispiel #1
0
 /*
  * Motivation for cached version is that in the operator form (foo@bar<-baz), the name is an
  * interned string which allows us to avoid longer lookup
  */
 @Specialization(guards = "sameName(nameObj, nameObjCached)")
 protected Object updateSlotCached(
     VirtualFrame frame,
     Object object,
     @SuppressWarnings("unused") Object nameObj,
     Object value,
     @SuppressWarnings("unused") @Cached("nameObj") Object nameObjCached,
     @Cached("getName(nameObjCached)") String name) {
   checkSlotAssign(frame, object, name, value);
   return updateSlotNode.executeUpdate(object, name, value);
 }
Beispiel #2
0
 @Specialization(contains = "updateSlotCached")
 protected Object updateSlot(VirtualFrame frame, Object object, Object nameObj, Object value) {
   String name = getName(nameObj);
   checkSlotAssign(frame, object, name, value);
   return updateSlotNode.executeUpdate(object, name, value);
 }