8136349: Typos patch for nashorn sources submitted on Sep 10, 2015

Reviewed-by: hannesw, mhaupt, lagergren, attila
This commit is contained in:
Ahmed Ashour 2015-09-11 15:43:36 +05:30 committed by Athijegannathan Sundararajan
parent 65dd9df8c9
commit 8be3c2c042
41 changed files with 49 additions and 55 deletions

View File

@ -117,7 +117,7 @@ import jdk.internal.dynalink.support.RuntimeContextLinkRequestImpl;
* return factory.createLinker();
* }
*
* public static CallSite bootstrap(MethodHandles.Lookup caller, String name, MethodType type) {
* public static CallSite bootstrap(MethodHandles.Lookup lookup, String name, MethodType type) {
* return dynamicLinker.link(new MonomorphicCallSite(CallSiteDescriptorFactory.create(lookup, name, type)));
* }
* }

View File

@ -152,7 +152,7 @@ abstract class FacetIntrospector {
boolean isAccessible(final Member m) {
final Class<?> declaring = m.getDeclaringClass();
// (declaring == clazz) is just an optimization - we're calling this only from code that operates on a
// non-restriced class, so if the declaring class is identical to the class being inspected, then forego
// non-restricted class, so if the declaring class is identical to the class being inspected, then forego
// a potentially expensive restricted-package check.
return declaring == clazz || !CheckRestrictedPackage.isRestrictedClass(declaring);
}

View File

@ -98,7 +98,6 @@ import jdk.internal.dynalink.support.Lookup;
* target method to a call site type (including mapping variable arity methods to a call site signature with different
* arity).
* @author Attila Szegedi
* @version $Id: $
*/
abstract class SingleDynamicMethod extends DynamicMethod {

View File

@ -353,7 +353,7 @@ public class GuardedInvocation {
/**
* Applies argument filters to both the invocation and the guard (if there is one).
* @param pos the position of the first argumen being filtered
* @param pos the position of the first argument being filtered
* @param filters the argument filters
* @return a filtered invocation
*/

View File

@ -110,7 +110,7 @@ public class GuardedTypeConversion {
/**
* Check if invocation is cacheable
* @return true if cachable, false otherwise
* @return true if cacheable, false otherwise
*/
public boolean isCacheable() {
return cacheable;

View File

@ -103,7 +103,7 @@ public final class URLReader extends Reader {
/**
* Charset used by this reader
*
* @return the Chartset used to convert bytes to chars
* @return the Charset used to convert bytes to chars
*/
public Charset getCharset() {
return cs;

View File

@ -80,7 +80,7 @@ public interface Parser {
public CompilationUnitTree parse(final URL url, final DiagnosticListener listener) throws IOException, NashornException;
/**
* Parses the readerand returns compilation unit tree
* Parses the reader and returns compilation unit tree
*
* @param name name of the source file to parse
* @param reader from which source is read
@ -133,7 +133,7 @@ public interface Parser {
* <dt>"-strict"</dt><dd>enable ECMAScript strict mode</dd>
* </dl>
*
* @throws NullPointerException if options arrry or any of it's element is null
* @throws NullPointerException if options array or any of its element is null
* @throws IllegalArgumentException on unsupported option value.
* @return a new Parser instance.
*/

View File

@ -35,7 +35,7 @@ public interface RegExpLiteralTree extends Tree {
/**
* Regular expression pattern to match.
*
* @return regular expression patten
* @return regular expression pattern
*/
public String getPattern();

View File

@ -244,7 +244,7 @@ final class AssignSymbols extends NodeVisitor<LexicalContext> implements Loggabl
/**
* Creates a synthetic initializer for a variable (a var statement that doesn't occur in the source code). Typically
* used to create assignmnent of {@code :callee} to the function name symbol in self-referential function
* used to create assignment of {@code :callee} to the function name symbol in self-referential function
* expressions as well as for assignment of {@code :arguments} to {@code arguments}.
*
* @param name the ident node identifying the variable to initialize

View File

@ -1494,7 +1494,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
int argsCount;
@Override
void loadStack() {
/**
/*
* We want to load 'eval' to check if it is indeed global builtin eval.
* If this eval call is inside a 'with' statement, dyn:getMethod|getProp|getElem
* would be generated if ident is a "isFunction". But, that would result in a
@ -4329,7 +4329,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
}
private void prologue() {
/**
/*
* This loads the parts of the target, e.g base and index. they are kept
* on the stack throughout the store and used at the end to execute it
*/
@ -4797,7 +4797,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
* conversion has no side effects.
* @param name the name of the property being get
* @param flags call site flags
* @param isMethod whether we're preferrably retrieving a function
* @param isMethod whether we're preferably retrieving a function
* @return the current method emitter
*/
MethodEmitter dynamicGet(final String name, final int flags, final boolean isMethod, final boolean isIndex) {
@ -5229,7 +5229,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
private Type returnValueType;
// If we are in the middle of an object literal initialization, we need to update the map
private PropertyMap objectLiteralMap;
// Object literal stack depth for object literal - not necessarly top if property is a tree
// Object literal stack depth for object literal - not necessarily top if property is a tree
private int objectLiteralStackDepth = -1;
// The line number at the continuation point
private int lineNumber;
@ -5394,7 +5394,7 @@ final class CodeGenerator extends NodeOperatorVisitor<CodeGeneratorLexicalContex
method.load(lvarTypes.get(slot), slot);
method.convert(stackTypes[i]);
// stack: s0=object literal being initialized
// change map of s0 so that the property we are initilizing when we failed
// change map of s0 so that the property we are initializing when we failed
// is now ci.returnValueType
if (i == objectLiteralStackDepth) {
method.dup();

View File

@ -745,7 +745,7 @@ enum CompilationPhase {
abstract FunctionNode transform(final Compiler compiler, final CompilationPhases phases, final FunctionNode functionNode) throws CompilationException;
/**
* Apply a transform to a function node, returning the transfored function node. If the transform is not
* Apply a transform to a function node, returning the transformed function node. If the transform is not
* applicable, an exception is thrown. Every transform requires the function to have a certain number of
* states to operate. It can have more states set, but not fewer. The state list, i.e. the constructor
* arguments to any of the CompilationPhase enum entries, is a set of REQUIRED states.

View File

@ -192,7 +192,7 @@ public enum CompilerConstants {
private static Set<String> symbolNames;
/**
* Prefix used for internal methods generated in script clases.
* Prefix used for internal methods generated in script classes.
*/
private static final String INTERNAL_METHOD_PREFIX = ":";
@ -225,7 +225,7 @@ public enum CompilerConstants {
}
/**
* Check whether a name is that of a reserved compiler constnat
* Check whether a name is that of a reserved compiler constant
* @param name name
* @return true if compiler constant name
*/

View File

@ -447,7 +447,7 @@ public final class Label implements Serializable {
undefineLocalVariables(liveLocalCount, true);
// Temporaries are promoted
firstTemp = liveLocalCount;
// No trailing undefineds
// No trailing undefined values
localVariableTypes.subList(firstTemp, localVariableTypes.size()).clear();
assert symbolBoundary.length() == firstTemp;
// Generalize all reference types to Object, and promote boolean to int

View File

@ -521,7 +521,7 @@ final class Lower extends NodeOperatorVisitor<BlockLexicalContext> implements Lo
}
/*
* create a new trynode
* create a new try node
* if we have catches:
*
* try try
@ -532,7 +532,7 @@ final class Lower extends NodeOperatorVisitor<BlockLexicalContext> implements Lo
* catchall
* rethrow
*
* otheriwse
* otherwise
*
* try try
* x x

View File

@ -1158,7 +1158,7 @@ public class MethodEmitter {
/**
* Pop a value from the stack and store it in a variable denoted by the given symbol. The variable should be either
* a local variable, or a function parameter (and not a scoped variable). For local variables, this method will also
* do the bookeeping of the local variable table as well as mark values in all alternative slots for the symbol as
* do the bookkeeping of the local variable table as well as mark values in all alternative slots for the symbol as
* dead. In this regard it differs from {@link #storeHidden(Type, int)}.
*
* @param symbol the symbol to store into.

View File

@ -786,7 +786,7 @@ public final class ObjectClassGenerator implements Loggable {
* @param primitiveSetter primitive setter for the current type with an element of the current type
* @param objectSetter the object setter
*
* @return method handle that checks if the element to be set is of the currenttype, even though it's boxed
* @return method handle that checks if the element to be set is of the current type, even though it's boxed
* and instead of using the generic object setter, that would blow up the type and invalidate the map,
* unbox it and call the primitive setter instead
*/

View File

@ -36,7 +36,7 @@ import jdk.internal.org.objectweb.asm.MethodVisitor;
* The bytecode ops are coupled to a MethodVisitor from ASM for
* byte code generation. They know nothing about our MethodGenerator,
* which is the abstraction for working with Nashorn JS types
* For exmaple, anything like "two or one slots" for a type, which
* For example, anything like "two or one slots" for a type, which
* is represented in bytecode and ASM, is abstracted away in the
* MethodGenerator. There you just say "dup" or "store".
*

View File

@ -34,7 +34,7 @@ import java.util.List;
* This is a subclass of lexical context used for filling
* blocks (and function nodes) with statements. When popping
* a block from the lexical context, any statements that have
* been generated in it are commited to the block. This saves
* been generated in it are committed to the block. This saves
* unnecessary object mutations and lexical context replacement
*/
public class BlockLexicalContext extends LexicalContext {

View File

@ -452,7 +452,7 @@ public abstract class LiteralNode<T> extends Expression implements PropertyKey {
*
* @param token token
* @param finish finish
* @param value undefined value, passed only for polymorphisism discrimination
* @param value undefined value, passed only for polymorphism discrimination
*
* @return the new literal node
*/

View File

@ -276,7 +276,7 @@ public class RuntimeNode extends Expression {
*
* @param request a request
*
* @return the inverted rquest, or null if not applicable
* @return the inverted request, or null if not applicable
*/
public static Request invert(final Request request) {
switch (request) {

View File

@ -36,7 +36,7 @@ import jdk.internal.org.objectweb.asm.Label;
import jdk.nashorn.internal.ir.debug.NashornTextifier.NashornLabel;
/**
* Subclass of the ASM classs reader that retains more info, such
* Subclass of the ASM class reader that retains more info, such
* as bytecode offsets
*/
public class NashornClassReader extends ClassReader {

View File

@ -193,7 +193,7 @@ public final class ObjectSizeCalculator {
}
/**
* Get the class histograpm
* Get the class histogram
* @return class histogram element list
*/
public List<ClassHistogramElement> getClassHistogram() {

View File

@ -192,7 +192,7 @@ public abstract class ArrayBufferView extends ScriptObject {
/**
* Factory method for array data
*
* @param nb underlying nativebuffer
* @param nb underlying native buffer
* @param start start element
* @param end end element
*

View File

@ -2166,7 +2166,7 @@ public final class Global extends Scope {
// We want to avoid adding our generic lexical scope switchpoint to global constant invocations,
// because those are invalidated per-key in the addBoundProperties method above.
// We therefor check if the invocation does already have a switchpoint and the property is non-inherited,
// We therefore check if the invocation does already have a switchpoint and the property is non-inherited,
// assuming this only applies to global constants. If other non-inherited properties will
// start using switchpoints some time in the future we'll have to revisit this.
if (isScope && context.getEnv()._es6 && (invocation.getSwitchPoints() == null || !hasOwnProperty(name))) {

View File

@ -728,7 +728,7 @@ public final class NativeRegExp extends ScriptObject {
*
* $$ -> $
* $& -> the matched substring
* $` -> the portion of string that preceeds matched substring
* $` -> the portion of string that precedes matched substring
* $' -> the portion of string that follows the matched substring
* $n -> the nth capture, where n is [1-9] and $n is NOT followed by a decimal digit
* $nn -> the nnth capture, where nn is a two digit decimal number [01-99].

View File

@ -808,7 +808,7 @@ loop:
if (!oldStrictMode && directiveStmts != null) {
// check that directives preceding this one do not violate strictness
for (final Node statement : directiveStmts) {
// the get value will force unescape of preceeding
// the get value will force unescape of preceding
// escaped string directives
getValue(statement.getToken());
}
@ -2507,7 +2507,7 @@ loop:
// run: function() { println("run"); }
// };
//
// The object literal following the "new Constructor()" expresssion
// The object literal following the "new Constructor()" expression
// is passed as an additional (last) argument to the constructor.
if (!env._no_syntax_extensions && type == LBRACE) {
arguments.add(objectLiteral());

View File

@ -90,7 +90,7 @@ abstract class ParserContextBaseNode implements ParserContextNode {
}
/**
* Adds a Statement at the end of the Statementlist
* Adds a statement at the end of the statement list
* @param statement The statement to add
*/
@Override
@ -99,7 +99,7 @@ abstract class ParserContextBaseNode implements ParserContextNode {
}
/**
* Adds a statement at the begining of the statementlist
* Adds a statement at the beginning of the statement list
* @param statement The statement to add
*/
@Override

View File

@ -53,13 +53,13 @@ interface ParserContextNode {
public void setStatements(final List<Statement> statements);
/**
* Adds a Statement at the end of the Statementlist
* Adds a statement at the end of the statement list
* @param statement The statement to add
*/
public void appendStatement(final Statement statement);
/**
* Adds a statement at the begining of the statementlist
* Adds a statement at the beginning of the statement list
* @param statement The statement to add
*/
public void prependStatement(final Statement statement);

View File

@ -102,7 +102,7 @@ final class CompiledFunction {
/*
* An optimistic builtin with isOptimistic=true works like any optimistic generated function, i.e. it
* can throw unwarranted optimism exceptions. As native functions trivially can't have parts of them
* regenerated as restof methods, this only works if the methods are atomic/functional in their behavior
* regenerated as "restOf" methods, this only works if the methods are atomic/functional in their behavior
* and doesn't modify state before an UOE can be thrown. If they aren't, we can reexecute a wider version
* of the same builtin in a recompilation handler for FinalScriptFunctionData. There are several
* candidate methods in Native* that would benefit from this, but I haven't had time to implement any
@ -567,7 +567,7 @@ final class CompiledFunction {
return handle;
}
// Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itslef
// Otherwise, we need a new level of indirection; need to introduce a mutable call site that can relink itself
// to the compiled function's changed target whenever the optimistic assumptions are invalidated.
final CallSite cs = new MutableCallSite(handle.type());
relinkComposableInvoker(cs, this, isConstructor);

View File

@ -153,7 +153,7 @@ public final class Context {
* Currently we are conservative and associate the name of a builtin class with all
* its properties, so it's enough to invalidate a property to break all assumptions
* about a prototype. This can be changed to a more fine grained approach, but no one
* ever needs this, given the very rare occurance of swapping out only parts of
* ever needs this, given the very rare occurrence of swapping out only parts of
* a builtin v.s. the entire builtin object
*/
private final Map<String, SwitchPoint> builtinSwitchPoints = new HashMap<>();
@ -1475,7 +1475,7 @@ public final class Context {
* @param level log level
* @param mh method handle
* @param paramStart first parameter to print
* @param printReturnValue should we print the return vaulue?
* @param printReturnValue should we print the return value?
* @param text debug printout to add
*
* @return instrumented method handle, or null if logger not enabled

View File

@ -297,4 +297,3 @@ public final class FindProperty {
}
}

View File

@ -67,7 +67,7 @@ import jdk.nashorn.internal.runtime.logging.Logger;
*
* Thus everything registered as a global constant gets an extra chance. Set once,
* reregister the switchpoint. Set twice or more - don't try again forever, or we'd
* just end up relinking our way into megamorphisism.
* just end up relinking our way into megamorphism.
*
* Also it has to be noted that this kind of linking creates a coupling between a Global
* and the call sites in compiled code belonging to the Context. For this reason, the

View File

@ -26,7 +26,6 @@
package jdk.nashorn.internal.runtime;
import java.lang.invoke.MethodHandle;
import java.util.Iterator;
import java.util.concurrent.Callable;
import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.parser.JSONParser;

View File

@ -1967,7 +1967,7 @@ public enum JSType {
/**
* Get the unboxed (primitive) type for an object
* @param o object
* @return primive type or Object.class if not primitive
* @return primitive type or Object.class if not primitive
*/
public static Class<?> unboxedFieldType(final Object o) {
if (o == null) {

View File

@ -38,7 +38,7 @@ public final class ParserException extends NashornException {
private final Source source;
// token responsible for this exception
private final long token;
// if this is traslated as ECMA error, which type should be used?
// if this is translated as ECMA error, which type should be used?
private final JSErrorType errorType;
/**

View File

@ -318,7 +318,7 @@ public abstract class ScriptFunctionData implements Serializable {
* Used to find an apply to call version that fits this callsite.
* We cannot just, as in the normal matcher case, return e.g. (Object, Object, int)
* for (Object, Object, int, int, int) or we will destroy the semantics and get
* a function that, when padded with undefineds, behaves differently
* a function that, when padded with undefined values, behaves differently
* @param type actual call site type
* @return apply to call that perfectly fits this callsite or null if none found
*/

View File

@ -191,7 +191,7 @@ public abstract class ContinuousArrayData extends ArrayData {
/**
* Return element setter for a {@link ContinuousArrayData}
* @param clazz clazz for exact type guard
* @param clazz class for exact type guard
* @param setHas set has guard
* @param elementType element type
* @return method handle for element setter

View File

@ -34,7 +34,7 @@ import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
* This filter handles the presence of undefined array elements.
*/
final class UndefinedArrayFilter extends ArrayFilter {
/** Bit vector tracking undefines. */
/** Bit vector tracking undefined slots. */
private final BitVector undefined;
UndefinedArrayFilter(final ArrayData underlying) {

View File

@ -26,7 +26,6 @@
package jdk.nashorn.internal.runtime.linker;
import static jdk.nashorn.internal.lookup.Lookup.MH;
import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
@ -42,13 +41,11 @@ import jdk.internal.dynalink.linker.LinkRequest;
import jdk.internal.dynalink.linker.LinkerServices;
import jdk.internal.dynalink.linker.MethodHandleTransformer;
import jdk.internal.dynalink.support.DefaultInternalObjectFilter;
import jdk.internal.dynalink.support.Guards;
import jdk.internal.dynalink.support.Lookup;
import jdk.nashorn.api.scripting.ScriptUtils;
import jdk.nashorn.internal.runtime.ConsString;
import jdk.nashorn.internal.runtime.Context;
import jdk.nashorn.internal.runtime.ScriptObject;
import jdk.nashorn.internal.runtime.ScriptRuntime;
import jdk.nashorn.internal.runtime.options.Options;
/**

View File

@ -65,7 +65,7 @@ public interface Config {
final boolean DONT_OPTIMIZE = false;
final boolean USE_STRING_TEMPLATES = true; // use embeded string templates in Regex object as byte arrays instead of compiling them into int bytecode array
final boolean USE_STRING_TEMPLATES = true; // use embedded string templates in Regex object as byte arrays instead of compiling them into int bytecode array
final boolean NON_UNICODE_SDW = true;

View File

@ -55,7 +55,7 @@ function parse(/*code, [name], [location]*/) {
// do not start with '/'. If regexp, then eval it to make RegExp object
return value.startsWith('/')? eval(value) : value.substring(1);
} else {
// anythin else is returned "as is""
// anything else is returned "as is"
return value;
}
});