| 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, | |
| 120 | 119 |
| 121 // Avoid calling the concat operation, because weird lengths | 120 // Avoid calling the concat operation, because weird lengths |
| 122 // may lead to out-of-memory. Ditto for StringBuilderJoin. | 121 // may lead to out-of-memory. Ditto for StringBuilderJoin. |
| 123 "StringBuilderConcat": true, | 122 "StringBuilderConcat": true, |
| 124 "StringBuilderJoin": true, | 123 "StringBuilderJoin": true, |
| 125 | 124 |
| 126 // These functions use pseudo-stack-pointers and are not robust | 125 // These functions use pseudo-stack-pointers and are not robust |
| 127 // to unexpected integer values. | 126 // to unexpected integer values. |
| 128 "DebugEvaluate": true, | 127 "DebugEvaluate": true, |
| 129 | 128 |
| 130 // These functions do nontrivial error checking in recursive calls, | 129 // These functions do nontrivial error checking in recursive calls, |
| 131 // which means that we have to propagate errors back. | 130 // which means that we have to propagate errors back. |
| 132 "SetFunctionBreakPoint": true, | 131 "SetFunctionBreakPoint": true, |
| 133 "SetScriptBreakPoint": true, | 132 "SetScriptBreakPoint": true, |
| 134 "PrepareStep": true, | 133 "PrepareStep": true, |
| 135 | 134 |
| 136 // Too slow. | 135 // Too slow. |
| 137 "DebugReferencedBy": true, | 136 "DebugReferencedBy": true, |
| 138 | 137 |
| 139 // Calling disable/enable access checks may interfere with the | 138 // Calling disable/enable access checks may interfere with the |
| 140 // the rest of the tests. | 139 // the rest of the tests. |
| 141 "DisableAccessChecks": true, | 140 "DisableAccessChecks": true, |
| 142 "EnableAccessChecks": true, | 141 "EnableAccessChecks": true, |
| 143 | 142 |
| 144 // These functions should not be callable as runtime functions. | 143 // IS_VAR is special. |
| 145 "NewFunctionContext": true, | |
| 146 "NewArgumentsFast": true, | |
| 147 "NewStrictArgumentsFast": true, | |
| 148 "PushWithContext": true, | |
| 149 "PushCatchContext": true, | |
| 150 "PushBlockContext": true, | |
| 151 "PushModuleContext": true, | |
| 152 "CompileUnoptimized": true, | |
| 153 "CompileOptimized": true, | |
| 154 "CompileOptimizedConcurrent": true, | |
| 155 "NotifyDeoptimized": true, | |
| 156 "NotifyStubFailure": true, | |
| 157 "NotifyOSR": true, | |
| 158 "CreateObjectLiteralBoilerplate": true, | |
| 159 "CloneLiteralBoilerplate": true, | |
| 160 "CloneShallowLiteralBoilerplate": true, | |
| 161 "CreateArrayLiteralBoilerplate": true, | |
| 162 "IS_VAR": true, | 144 "IS_VAR": true, |
| 163 "ResolvePossiblyDirectEval": true, | |
| 164 "DeclareGlobals": true, | |
| 165 "ArrayConstructor": true, | |
| 166 "InternalArrayConstructor": true, | |
| 167 | |
| 168 "PromoteScheduledException": true, | |
| 169 "DeleteHandleScopeExtensions": true, | |
| 170 | 145 |
| 171 // Vararg with minimum number > 0. | 146 // Vararg with minimum number > 0. |
| 172 "Call": true, | 147 "Call": true, |
| 173 "SetAllocationTimeout": true, | 148 "SetAllocationTimeout": true, |
| 174 | 149 |
| 175 // Requires integer arguments to be non-negative. | 150 // Requires integer arguments to be non-negative. |
| 176 "Apply": true, | 151 "Apply": true, |
| 177 | 152 |
| 178 // That can only be invoked on Array.prototype. | 153 // That can only be invoked on Array.prototype. |
| 179 "FinishArrayPrototypeSetup": true, | 154 "FinishArrayPrototypeSetup": true, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 205 "_TwoByteSeqStringSetChar": true, | 180 "_TwoByteSeqStringSetChar": true, |
| 206 | 181 |
| 207 // Only applicable to TypedArrays. | 182 // Only applicable to TypedArrays. |
| 208 "_TypedArrayInitialize": true, | 183 "_TypedArrayInitialize": true, |
| 209 | 184 |
| 210 // Only applicable to generators. | 185 // Only applicable to generators. |
| 211 "_GeneratorNext": true, | 186 "_GeneratorNext": true, |
| 212 "_GeneratorThrow": true, | 187 "_GeneratorThrow": true, |
| 213 | 188 |
| 214 // Only applicable to DataViews. | 189 // Only applicable to DataViews. |
| 215 "_DataViewInitialize":true, | 190 "_DataViewInitialize": true, |
| 216 }; | 191 }; |
| 217 | 192 |
| 218 var currentlyUncallable = { | 193 var currentlyUncallable = { |
| 219 // We need to find a way to test this without breaking the system. | 194 // We need to find a way to test this without breaking the system. |
| 220 "SystemBreak": true, | 195 "SystemBreak": true, |
| 221 // Inserts an int3/stop instruction when run with --always-opt. | 196 // Inserts an int3/stop instruction when run with --always-opt. |
| 222 "_DebugBreakInOptimizedCode": true | 197 "_DebugBreakInOptimizedCode": true |
| 223 }; | 198 }; |
| 224 | 199 |
| 225 function testNatives() { | 200 function testNatives() { |
| 226 var allNatives = %ListNatives(); | 201 var allNatives = %ListNatives(); |
| 227 var start = (allNatives.length >> 2)*2; | 202 var start = (allNatives.length >> 2)*2; |
| 228 var stop = (allNatives.length >> 2)*3; | 203 var stop = (allNatives.length >> 2)*3; |
| 229 for (var i = start; i < stop; i++) { | 204 for (var i = start; i < stop; i++) { |
| 230 var nativeInfo = allNatives[i]; | 205 var nativeInfo = allNatives[i]; |
| 231 var name = nativeInfo[0]; | 206 var name = nativeInfo[0]; |
| 232 if (name in knownProblems || name in currentlyUncallable) | 207 if (name in knownProblems || name in currentlyUncallable) |
| 233 continue; | 208 continue; |
| 234 print(name); | 209 print(name); |
| 235 var argc = nativeInfo[1]; | 210 var argc = nativeInfo[1]; |
| 236 testArgumentCount(name, argc); | 211 testArgumentCount(name, argc); |
| 237 testArgumentTypes(name, argc); | 212 testArgumentTypes(name, argc); |
| 238 } | 213 } |
| 239 } | 214 } |
| 240 | 215 |
| 241 testNatives(); | 216 testNatives(); |
| OLD | NEW |