| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 func.apply(void 0, argList); | 109 func.apply(void 0, argList); |
| 110 } catch (e) { | 110 } catch (e) { |
| 111 // we don't care what happens as long as we don't crash | 111 // we don't care what happens as long as we don't crash |
| 112 } | 112 } |
| 113 type++; | 113 type++; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 var knownProblems = { | 117 var knownProblems = { |
| 118 "Abort": true, | 118 "Abort": true, |
| 119 "ThrowMessage": true, |
| 119 | 120 |
| 120 // Avoid calling the concat operation, because weird lengths | 121 // Avoid calling the concat operation, because weird lengths |
| 121 // may lead to out-of-memory. Ditto for StringBuilderJoin. | 122 // may lead to out-of-memory. Ditto for StringBuilderJoin. |
| 122 "StringBuilderConcat": true, | 123 "StringBuilderConcat": true, |
| 123 "StringBuilderJoin": true, | 124 "StringBuilderJoin": true, |
| 124 | 125 |
| 125 // These functions use pseudo-stack-pointers and are not robust | 126 // These functions use pseudo-stack-pointers and are not robust |
| 126 // to unexpected integer values. | 127 // to unexpected integer values. |
| 127 "DebugEvaluate": true, | 128 "DebugEvaluate": true, |
| 128 | 129 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 "_HasCachedArrayIndex": true, | 202 "_HasCachedArrayIndex": true, |
| 202 "_GetCachedArrayIndex": true, | 203 "_GetCachedArrayIndex": true, |
| 203 "_OneByteSeqStringSetChar": true, | 204 "_OneByteSeqStringSetChar": true, |
| 204 "_TwoByteSeqStringSetChar": true, | 205 "_TwoByteSeqStringSetChar": true, |
| 205 | 206 |
| 206 // Only applicable to generators. | 207 // Only applicable to generators. |
| 207 "_GeneratorNext": true, | 208 "_GeneratorNext": true, |
| 208 "_GeneratorThrow": true, | 209 "_GeneratorThrow": true, |
| 209 | 210 |
| 210 // Only applicable to DataViews. | 211 // Only applicable to DataViews. |
| 212 "DataViewInitialize": true, |
| 211 "DataViewGetBuffer": true, | 213 "DataViewGetBuffer": true, |
| 212 "DataViewGetByteLength": true, | 214 "DataViewGetByteLength": true, |
| 213 "DataViewGetByteOffset": true | 215 "DataViewGetByteOffset": true |
| 214 }; | 216 }; |
| 215 | 217 |
| 216 var currentlyUncallable = { | 218 var currentlyUncallable = { |
| 217 // We need to find a way to test this without breaking the system. | 219 // We need to find a way to test this without breaking the system. |
| 218 "SystemBreak": true, | 220 "SystemBreak": true, |
| 219 // Inserts an int3/stop instruction when run with --always-opt. | 221 // Inserts an int3/stop instruction when run with --always-opt. |
| 220 "_DebugBreakInOptimizedCode": true | 222 "_DebugBreakInOptimizedCode": true |
| 221 }; | 223 }; |
| 222 | 224 |
| 223 function testNatives() { | 225 function testNatives() { |
| 224 var allNatives = %ListNatives(); | 226 var allNatives = %ListNatives(); |
| 225 var start = (allNatives.length >> 2)*3; | 227 var start = (allNatives.length >> 2)*3; |
| 226 var stop = allNatives.length; | 228 var stop = allNatives.length; |
| 227 for (var i = start; i < stop; i++) { | 229 for (var i = start; i < stop; i++) { |
| 228 var nativeInfo = allNatives[i]; | 230 var nativeInfo = allNatives[i]; |
| 229 var name = nativeInfo[0]; | 231 var name = nativeInfo[0]; |
| 230 if (name in knownProblems || name in currentlyUncallable) | 232 if (name in knownProblems || name in currentlyUncallable) |
| 231 continue; | 233 continue; |
| 232 print(name); | 234 print(name); |
| 233 var argc = nativeInfo[1]; | 235 var argc = nativeInfo[1]; |
| 234 testArgumentCount(name, argc); | 236 testArgumentCount(name, argc); |
| 235 testArgumentTypes(name, argc); | 237 testArgumentTypes(name, argc); |
| 236 } | 238 } |
| 237 } | 239 } |
| 238 | 240 |
| 239 testNatives(); | 241 testNatives(); |
| OLD | NEW |