src/jdk/nashorn/internal/runtime/Property.java

Print this page




  35 import jdk.nashorn.internal.codegen.types.Type;
  36 
  37 /**
  38  * This is the abstract superclass representing a JavaScript Property.
  39  * The {@link PropertyMap} map links keys to properties, and consequently
  40  * instances of this class make up the values in the PropertyMap
  41  *
  42  * @see PropertyMap
  43  * @see AccessorProperty
  44  * @see UserAccessorProperty
  45  */
  46 public abstract class Property {
  47     /*
  48      * ECMA 8.6.1 Property Attributes
  49      *
  50      * We use negative flags because most properties are expected to
  51      * be 'writable', 'configurable' and 'enumerable'. With negative flags,
  52      * we can use leave flag byte initialized with (the default) zero value.
  53      */
  54 


  55     /** ECMA 8.6.1 - Is this property not writable? */
  56     public static final int NOT_WRITABLE     = 0b0000_0000_0001;
  57 
  58     /** ECMA 8.6.1 - Is this property not enumerable? */
  59     public static final int NOT_ENUMERABLE   = 0b0000_0000_0010;
  60 
  61     /** ECMA 8.6.1 - Is this property not configurable? */
  62     public static final int NOT_CONFIGURABLE = 0b0000_0000_0100;
  63 
  64     private static final int MODIFY_MASK     = 0b0000_0000_1111;
  65 
  66     /** Is this a spill property? See {@link AccessorProperty} */
  67     public static final int IS_SPILL         = 0b0000_0001_0000;
  68 
  69     /** Is this a function parameter? */
  70     public static final int IS_PARAMETER     = 0b0000_0010_0000;
  71 
  72     /** Is parameter accessed thru arguments? */
  73     public static final int HAS_ARGUMENTS    = 0b0000_0100_0000;
  74 




  35 import jdk.nashorn.internal.codegen.types.Type;
  36 
  37 /**
  38  * This is the abstract superclass representing a JavaScript Property.
  39  * The {@link PropertyMap} map links keys to properties, and consequently
  40  * instances of this class make up the values in the PropertyMap
  41  *
  42  * @see PropertyMap
  43  * @see AccessorProperty
  44  * @see UserAccessorProperty
  45  */
  46 public abstract class Property {
  47     /*
  48      * ECMA 8.6.1 Property Attributes
  49      *
  50      * We use negative flags because most properties are expected to
  51      * be 'writable', 'configurable' and 'enumerable'. With negative flags,
  52      * we can use leave flag byte initialized with (the default) zero value.
  53      */
  54 
  55     public static final int WRITABLE_ENUMERABLE_CONFIGURABLE = 0b0000_0000_0000;
  56 
  57     /** ECMA 8.6.1 - Is this property not writable? */
  58     public static final int NOT_WRITABLE     = 0b0000_0000_0001;
  59 
  60     /** ECMA 8.6.1 - Is this property not enumerable? */
  61     public static final int NOT_ENUMERABLE   = 0b0000_0000_0010;
  62 
  63     /** ECMA 8.6.1 - Is this property not configurable? */
  64     public static final int NOT_CONFIGURABLE = 0b0000_0000_0100;
  65 
  66     private static final int MODIFY_MASK     = 0b0000_0000_1111;
  67 
  68     /** Is this a spill property? See {@link AccessorProperty} */
  69     public static final int IS_SPILL         = 0b0000_0001_0000;
  70 
  71     /** Is this a function parameter? */
  72     public static final int IS_PARAMETER     = 0b0000_0010_0000;
  73 
  74     /** Is parameter accessed thru arguments? */
  75     public static final int HAS_ARGUMENTS    = 0b0000_0100_0000;
  76