Java Code Examples for jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode#getSplitRanges()
The following examples show how to use
jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode#getSplitRanges() .
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: ReplaceCompileUnits.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 2
Source File: WeighNodes.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }
Example 3
Source File: ReplaceCompileUnits.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 4
Source File: WeighNodes.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }
Example 5
Source File: ReplaceCompileUnits.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 6
Source File: WeighNodes.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }
Example 7
Source File: ReplaceCompileUnits.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 8
Source File: WeighNodes.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { if (literalNode instanceof LiteralNode.PrimitiveLiteralNode) { weight += CONST_WEIGHT; return false; } weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }
Example 9
Source File: ReplaceCompileUnits.java From hottub with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 10
Source File: WeighNodes.java From hottub with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }
Example 11
Source File: ReplaceCompileUnits.java From jdk8u_nashorn with GNU General Public License v2.0 | 5 votes |
@Override public Node leaveLiteralNode(final LiteralNode<?> node) { if (node instanceof ArrayLiteralNode) { final ArrayLiteralNode aln = (ArrayLiteralNode)node; if (aln.getSplitRanges() == null) { return node; } final List<Splittable.SplitRange> newArrayUnits = new ArrayList<>(); for (final Splittable.SplitRange au : aln.getSplitRanges()) { newArrayUnits.add(new Splittable.SplitRange(getExistingReplacement(au), au.getLow(), au.getHigh())); } return aln.setSplitRanges(lc, newArrayUnits); } return node; }
Example 12
Source File: WeighNodes.java From jdk8u_nashorn with GNU General Public License v2.0 | 5 votes |
@SuppressWarnings("rawtypes") @Override public boolean enterLiteralNode(final LiteralNode literalNode) { weight += LITERAL_WEIGHT; if (literalNode instanceof ArrayLiteralNode) { final ArrayLiteralNode arrayLiteralNode = (ArrayLiteralNode)literalNode; final Node[] value = arrayLiteralNode.getValue(); final int[] postsets = arrayLiteralNode.getPostsets(); final List<Splittable.SplitRange> units = arrayLiteralNode.getSplitRanges(); if (units == null) { for (final int postset : postsets) { weight += AASTORE_WEIGHT; final Node element = value[postset]; if (element != null) { element.accept(this); } } } return false; } return true; }