| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 %OptimizeFunctionOnNextCall(create0); | 185 %OptimizeFunctionOnNextCall(create0); |
| 186 create0(); | 186 create0(); |
| 187 // This test only makes sense if crankshaft is allowed | 187 // This test only makes sense if crankshaft is allowed |
| 188 if (4 != %GetOptimizationStatus(create0)) { | 188 if (4 != %GetOptimizationStatus(create0)) { |
| 189 create0(); | 189 create0(); |
| 190 b = create0(); | 190 b = create0(); |
| 191 assertKind(elements_kind.fast_smi_only, b); | 191 assertKind(elements_kind.fast_smi_only, b); |
| 192 b[0] = 3.5; | 192 b[0] = 3.5; |
| 193 c = create0(); | 193 c = create0(); |
| 194 assertKind(elements_kind.fast_double, c); | 194 assertKind(elements_kind.fast_double, c); |
| 195 assertTrue(2 != %GetOptimizationStatus(create0)); | 195 assertOptimized(create0); |
| 196 } | 196 } |
| 197 })(); | 197 })(); |
| 198 | 198 |
| 199 | 199 |
| 200 // Verify that cross context calls work | 200 // Verify that cross context calls work |
| 201 (function (){ | 201 (function (){ |
| 202 var realmA = Realm.current(); | 202 var realmA = Realm.current(); |
| 203 var realmB = Realm.create(); | 203 var realmB = Realm.create(); |
| 204 assertEquals(0, realmA); | 204 assertEquals(0, realmA); |
| 205 assertEquals(1, realmB); | 205 assertEquals(1, realmB); |
| 206 | 206 |
| 207 function instanceof_check(type) { | 207 function instanceof_check(type) { |
| 208 assertTrue(type() instanceof type); | 208 assertTrue(type() instanceof type); |
| 209 assertTrue(type(5) instanceof type); | 209 assertTrue(type(5) instanceof type); |
| 210 assertTrue(type(1,2,3) instanceof type); | 210 assertTrue(type(1,2,3) instanceof type); |
| 211 } | 211 } |
| 212 | 212 |
| 213 var realmBArray = Realm.eval(realmB, "Array"); | 213 var realmBArray = Realm.eval(realmB, "Array"); |
| 214 instanceof_check(Array); | 214 instanceof_check(Array); |
| 215 instanceof_check(Array); | 215 instanceof_check(Array); |
| 216 instanceof_check(Array); | 216 instanceof_check(Array); |
| 217 instanceof_check(realmBArray); | 217 instanceof_check(realmBArray); |
| 218 instanceof_check(realmBArray); | 218 instanceof_check(realmBArray); |
| 219 instanceof_check(realmBArray); | 219 instanceof_check(realmBArray); |
| 220 })(); | 220 })(); |
| 221 } | 221 } |
| OLD | NEW |