nashorn/test/script/basic/arrays.js.EXPECTED
author attila
Thu, 31 Jan 2013 18:34:42 +0100
changeset 16206 83069fa0935b
parent 16147 e63b63819133
permissions -rw-r--r--
8006529: Methods always get callee - it should be conditional Summary: This commit streamlines the bytecode function signatures, prologue, local variable use, scope creation, and invocation. It started out quite innocently when we noticed that we always emit __callee__ parameters for all functions even when they are not needed, but it turned out to be quite a deep rabbit hole. In the end, I identified exact conditions when functions need to have a callee parameter, when they need to receive parent scope, when they need to create their own scope, when they need to have variable arity signature, and when they need to have an "arguments" object, and made sure that callee parameters in signatures only show up when they are needed, that parent function's scope is only passed to a child function when it is needed, that the function only creates its own scope when it is needed. In crypto.js, the number of scopes dropped from 446 to 244, and the number of callees dropped from 315 to 145. Reviewed-by: jlaskey, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16147
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     1
3
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     2
isArray.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     3
false
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     4
true
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     5
join.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     6
javascript<->is<->great
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     7
every.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     8
4,56,5 every even? = false
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
     9
4,56,688 every even? = true
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    10
some.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    11
4,56,5 some even? = true
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    12
3,5,17 some even? = false
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    13
forEach.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    14
java,javascript,jython,jruby[0] is java
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    15
java,javascript,jython,jruby[1] is javascript
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    16
java,javascript,jython,jruby[2] is jython
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    17
java,javascript,jython,jruby[3] is jruby
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    18
JAVA,JAVASCRIPT,JYTHON,JRUBY
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    19
shifted is java, remaining is javascript,jython,jruby, length is 3
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    20
java,javascript
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    21
115
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    22
120
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    23
c++ java javascript objective c
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    24
hello world from javascript
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    25
indexOf.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    26
indexOf('java') = 0
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    27
indexOf('javascript') = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    28
indexOf('javascript', 3) = -1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    29
indexOf('c++') = -1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    30
[].indexOf('any') = -1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    31
lastIndexOf.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    32
lastIndexOf('java') = 4
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    33
lastIndexOf('jython') = 5
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    34
lastIndexOf('c') = 6
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    35
lastIndexOf('c++') = -1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    36
[].lastIndexOf('any') = -1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    37
concat.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    38
foo,bar,x,y,34,sss,3,4,2
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    39
Array.length = 1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    40
NaN,NaN,NaN
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    41
3
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    42
1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    43
number
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    44
1
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    45
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    46
hello,world
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    47
,,,,
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    48
undefined
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    49
[object java.lang.Object]
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    50
e63b63819133 8005403: Open-source Nashorn
jlaskey
parents:
diff changeset
    51
33