new CodeSnippetSingleNameReference( this.identifierStack[this.identifierPtr], this.identifierPositionStack[this.identifierPtr--],
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { if (!codegenField.isStatic()) { // need a receiver? if ((this.bits & DepthMASK) != 0) { codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); fieldStore(currentScope, codeStream, codegenField, null, this.actualReceiverType, this.delegateThis == null /*implicit this*/, valueRequired); if (valueRequired) { codeStream.generateImplicitConversion(assignment.implicitConversion); generateReceiver(codeStream);
Constant fieldConstant = codegenField.constant(); if (fieldConstant == Constant.NotAConstant) { // directly use inlined value for constant fields if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType; TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */); codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); generateReceiver(codeStream); checkEffectiveFinality(localBinding, currentScope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream);
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { if (this.delegateThis == null) { return super.checkFieldAccess(scope); } FieldBinding fieldBinding = (FieldBinding) this.binding; this.bits &= ~RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; if (!fieldBinding.isStatic()) { // must check for the static status.... if (this.evaluationContext.isStatic) { scope.problemReporter().staticFieldAccessToNonStaticVariable( this, fieldBinding); this.constant = Constant.NotAConstant; return null; } } this.constant = fieldBinding.constant(scope); if (isFieldUseDeprecated(fieldBinding, scope, this.bits)) { scope.problemReporter().deprecatedField(fieldBinding, this); } return fieldBinding.type; } public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
return super.reportError(scope); return checkFieldAccess(scope); return checkFieldAccess(scope); } else { return super.reportError(scope); return checkFieldAccess(scope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { if (!codegenField.isStatic()) { // need a receiver? if ((this.bits & DepthMASK) != 0) { codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); fieldStore(currentScope, codeStream, codegenField, null, this.actualReceiverType, this.delegateThis == null /*implicit this*/, valueRequired); if (valueRequired) { codeStream.generateImplicitConversion(assignment.implicitConversion); generateReceiver(codeStream);
Constant fieldConstant = codegenField.constant(); if (fieldConstant == Constant.NotAConstant) { // directly use inlined value for constant fields if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType; TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */); codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); generateReceiver(codeStream); checkEffectiveFinality(localBinding, currentScope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream);
if (isFieldUseDeprecated(fieldBinding, scope, this.bits)) { scope.problemReporter().deprecatedField(fieldBinding, this);
return super.reportError(scope); return checkFieldAccess(scope); return checkFieldAccess(scope); } else { return super.reportError(scope); return checkFieldAccess(scope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { if (!codegenField.isStatic()) { // need a receiver? if ((this.bits & DepthMASK) != 0) { codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); fieldStore(currentScope, codeStream, codegenField, null, this.actualReceiverType, this.delegateThis == null /*implicit this*/, valueRequired); if (valueRequired) { codeStream.generateImplicitConversion(assignment.implicitConversion); generateReceiver(codeStream);
Constant fieldConstant = codegenField.constant(); if (fieldConstant == Constant.NotAConstant) { // directly use inlined value for constant fields if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType; TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */); codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); generateReceiver(codeStream); checkEffectiveFinality(localBinding, currentScope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream);
new CodeSnippetSingleNameReference( this.identifierStack[this.identifierPtr], this.identifierPositionStack[this.identifierPtr--],
/** * Check and/or redirect the field access to the delegate receiver if any */ public TypeBinding checkFieldAccess(BlockScope scope) { if (this.delegateThis == null) { return super.checkFieldAccess(scope); } FieldBinding fieldBinding = (FieldBinding) this.binding; this.bits &= ~RestrictiveFlagMASK; // clear bits this.bits |= Binding.FIELD; if (!fieldBinding.isStatic()) { // must check for the static status.... if (this.evaluationContext.isStatic) { scope.problemReporter().staticFieldAccessToNonStaticVariable( this, fieldBinding); this.constant = Constant.NotAConstant; return null; } } this.constant = fieldBinding.constant(); if (isFieldUseDeprecated(fieldBinding, scope, this.bits)) { scope.problemReporter().deprecatedField(fieldBinding, this); } return fieldBinding.type; } public void generateAssignment(BlockScope currentScope, CodeStream codeStream, Assignment assignment, boolean valueRequired) {
return super.reportError(scope); return checkFieldAccess(scope); return checkFieldAccess(scope); } else { return super.reportError(scope); return checkFieldAccess(scope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { if (!codegenField.isStatic()) { // need a receiver? if ((this.bits & DepthMASK) != 0) { codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); fieldStore(currentScope, codeStream, codegenField, null, this.actualReceiverType, this.delegateThis == null /*implicit this*/, valueRequired); if (valueRequired) { codeStream.generateImplicitConversion(assignment.implicitConversion); generateReceiver(codeStream);
Constant fieldConstant = codegenField.constant(); if (fieldConstant == Constant.NotAConstant) { // directly use inlined value for constant fields if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { TypeBinding someReceiverType = this.delegateThis != null ? this.delegateThis.type : this.actualReceiverType; TypeBinding constantPoolDeclaringClass = CodeStream.getConstantPoolDeclaringClass(currentScope, codegenField, someReceiverType, true /* implicit this */); codeStream.generateOuterAccess(emulationPath, this, targetType, currentScope); } else { generateReceiver(codeStream); generateReceiver(codeStream); checkEffectiveFinality(localBinding, currentScope);
case Binding.FIELD : // assigning to a field FieldBinding codegenField = ((FieldBinding) this.binding).original(); if (codegenField.canBeSeenBy(getReceiverType(currentScope), this, currentScope)) { super.generatePostIncrement(currentScope, codeStream, postIncrement, valueRequired); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream); codeStream.aconst_null(); } else { generateReceiver(codeStream);