jdk.nashorn.internal.ir.ObjectNode Java Examples

The following examples show how to use jdk.nashorn.internal.ir.ObjectNode. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WeighNodes.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #2
Source File: WeighNodes.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #3
Source File: WeighNodes.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #4
Source File: WeighNodes.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #5
Source File: WeighNodes.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #6
Source File: WeighNodes.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    weight += OBJECT_WEIGHT;
    final List<PropertyNode> properties = objectNode.getElements();
    final boolean isSpillObject = properties.size() > CodeGenerator.OBJECT_SPILL_THRESHOLD;

    for (final PropertyNode property : properties) {
        if (!LiteralNode.isConstant(property.getValue())) {
            weight += SETPROP_WEIGHT;
            property.getValue().accept(this);
        } else if (!isSpillObject) {
            // constants in spill object are set via preset spill array,
            // but fields objects need to set constants.
            weight += SETPROP_WEIGHT;
        }

    }

    return false;
}
 
Example #7
Source File: JSONWriter.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #8
Source File: LocalVariableTypesCalculator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #9
Source File: JSONWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #10
Source File: ReplaceCompileUnits.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveObjectNode(final ObjectNode objectNode) {
    final List<Splittable.SplitRange> ranges = objectNode.getSplitRanges();
    if (ranges != null) {
        final List<Splittable.SplitRange> newRanges = new ArrayList<>();
        for (final Splittable.SplitRange range : ranges) {
            newRanges.add(new Splittable.SplitRange(getExistingReplacement(range), range.getLow(), range.getHigh()));
        }
        return objectNode.setSplitRanges(lc, newRanges);
    }
    return super.leaveObjectNode(objectNode);
}
 
Example #11
Source File: LocalVariableTypesCalculator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #12
Source File: JSONWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #13
Source File: ReplaceCompileUnits.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveObjectNode(final ObjectNode objectNode) {
    final List<Splittable.SplitRange> ranges = objectNode.getSplitRanges();
    if (ranges != null) {
        final List<Splittable.SplitRange> newRanges = new ArrayList<>();
        for (final Splittable.SplitRange range : ranges) {
            newRanges.add(new Splittable.SplitRange(getExistingReplacement(range), range.getLow(), range.getHigh()));
        }
        return objectNode.setSplitRanges(lc, newRanges);
    }
    return super.leaveObjectNode(objectNode);
}
 
Example #14
Source File: JSONWriter.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #15
Source File: JSONWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #16
Source File: LocalVariableTypesCalculator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #17
Source File: JSONWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #18
Source File: LocalVariableTypesCalculator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #19
Source File: ReplaceCompileUnits.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveObjectNode(final ObjectNode objectNode) {
    final List<Splittable.SplitRange> ranges = objectNode.getSplitRanges();
    if (ranges != null) {
        final List<Splittable.SplitRange> newRanges = new ArrayList<>();
        for (final Splittable.SplitRange range : ranges) {
            newRanges.add(new Splittable.SplitRange(getExistingReplacement(range), range.getLow(), range.getHigh()));
        }
        return objectNode.setSplitRanges(lc, newRanges);
    }
    return super.leaveObjectNode(objectNode);
}
 
Example #20
Source File: IRTranslator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    final List<PropertyNode> propNodes = objectNode.getElements();
    final List<? extends PropertyTree> propTrees = translateProperties(propNodes);
    curExpr = new ObjectLiteralTreeImpl(objectNode, propTrees);
    return false;
}
 
Example #21
Source File: JSONWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #22
Source File: JSONWriter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #23
Source File: ReplaceCompileUnits.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveObjectNode(final ObjectNode objectNode) {
    final List<Splittable.SplitRange> ranges = objectNode.getSplitRanges();
    if (ranges != null) {
        final List<Splittable.SplitRange> newRanges = new ArrayList<>();
        for (final Splittable.SplitRange range : ranges) {
            newRanges.add(new Splittable.SplitRange(getExistingReplacement(range), range.getLow(), range.getHigh()));
        }
        return objectNode.setSplitRanges(lc, newRanges);
    }
    return super.leaveObjectNode(objectNode);
}
 
Example #24
Source File: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterForNode(final ForNode forNode) {
    if (es6 && (forNode.getInit() instanceof ObjectNode || forNode.getInit() instanceof ArrayLiteralNode)) {
        throwNotImplementedYet("es6.destructuring", forNode);
    }
    return super.enterForNode(forNode);
}
 
Example #25
Source File: Lower.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterASSIGN(BinaryNode binaryNode) {
    if (es6 && (binaryNode.lhs() instanceof ObjectNode || binaryNode.lhs() instanceof ArrayLiteralNode)) {
        throwNotImplementedYet("es6.destructuring", binaryNode);
    }
    return super.enterASSIGN(binaryNode);
}
 
Example #26
Source File: LocalVariableTypesCalculator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #27
Source File: JSONWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}
 
Example #28
Source File: ReplaceCompileUnits.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Node leaveObjectNode(final ObjectNode objectNode) {
    final List<Splittable.SplitRange> ranges = objectNode.getSplitRanges();
    if (ranges != null) {
        final List<Splittable.SplitRange> newRanges = new ArrayList<>();
        for (final Splittable.SplitRange range : ranges) {
            newRanges.add(new Splittable.SplitRange(getExistingReplacement(range), range.getLow(), range.getHigh()));
        }
        return objectNode.setSplitRanges(lc, newRanges);
    }
    return super.leaveObjectNode(objectNode);
}
 
Example #29
Source File: LocalVariableTypesCalculator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    for(final PropertyNode propertyNode: objectNode.getElements()) {
        // Avoid falsely adding property keys to the control flow graph
        final Expression value = propertyNode.getValue();
        if (value != null) {
            visitExpression(value);
        }
    }
    return pushExpressionType(objectNode);
}
 
Example #30
Source File: JSONWriter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean enterObjectNode(final ObjectNode objectNode) {
    enterDefault(objectNode);

    type("ObjectExpression");
    comma();

    array("properties", objectNode.getElements());

    return leave();
}