| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 try { | 108 try { |
| 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 | 119 |
| 120 // Avoid calling the concat operation, because weird lengths | 120 // Avoid calling the concat operation, because weird lengths |
| 121 // may lead to out-of-memory. Ditto for StringBuilderJoin. | 121 // may lead to out-of-memory. Ditto for StringBuilderJoin. |
| 122 "StringBuilderConcat": true, | 122 "_StringBuilderConcat": true, |
| 123 "StringBuilderJoin": true, | 123 "_StringBuilderJoin": true, |
| 124 | 124 |
| 125 // These functions use pseudo-stack-pointers and are not robust | 125 // These functions use pseudo-stack-pointers and are not robust |
| 126 // to unexpected integer values. | 126 // to unexpected integer values. |
| 127 "DebugEvaluate": true, | 127 "_DebugEvaluate": true, |
| 128 | 128 |
| 129 // These functions do nontrivial error checking in recursive calls, | 129 // These functions do nontrivial error checking in recursive calls, |
| 130 // which means that we have to propagate errors back. | 130 // which means that we have to propagate errors back. |
| 131 "SetFunctionBreakPoint": true, | 131 "_SetFunctionBreakPoint": true, |
| 132 "SetScriptBreakPoint": true, | 132 "_SetScriptBreakPoint": true, |
| 133 "PrepareStep": true, | 133 "_PrepareStep": true, |
| 134 | 134 |
| 135 // Too slow. | 135 // Too slow. |
| 136 "DebugReferencedBy": true, | 136 "_DebugReferencedBy": true, |
| 137 | 137 |
| 138 // Calling disable/enable access checks may interfere with the | 138 // Calling disable/enable access checks may interfere with the |
| 139 // the rest of the tests. | 139 // the rest of the tests. |
| 140 "DisableAccessChecks": true, | 140 "_DisableAccessChecks": true, |
| 141 "EnableAccessChecks": true, | 141 "_EnableAccessChecks": true, |
| 142 | 142 |
| 143 // These functions should not be callable as runtime functions. | 143 // These functions should not be callable as runtime functions. |
| 144 "NewFunctionContext": true, | 144 "_NewFunctionContext": true, |
| 145 "NewArgumentsFast": true, | 145 "_NewArgumentsFast": true, |
| 146 "NewStrictArgumentsFast": true, | 146 "_NewStrictArgumentsFast": true, |
| 147 "PushWithContext": true, | 147 "_PushWithContext": true, |
| 148 "PushCatchContext": true, | 148 "_PushCatchContext": true, |
| 149 "PushBlockContext": true, | 149 "_PushBlockContext": true, |
| 150 "PushModuleContext": true, | 150 "_PushModuleContext": true, |
| 151 "LazyCompile": true, | 151 "_LazyCompile": true, |
| 152 "LazyRecompile": true, | 152 "_LazyRecompile": true, |
| 153 "ParallelRecompile": true, | 153 "_ParallelRecompile": true, |
| 154 "NotifyDeoptimized": true, | 154 "_NotifyDeoptimized": true, |
| 155 "NotifyStubFailure": true, | 155 "_NotifyStubFailure": true, |
| 156 "NotifyOSR": true, | 156 "_NotifyOSR": true, |
| 157 "CreateObjectLiteralBoilerplate": true, | 157 "_CreateObjectLiteralBoilerplate": true, |
| 158 "CloneLiteralBoilerplate": true, | 158 "_CloneLiteralBoilerplate": true, |
| 159 "CloneShallowLiteralBoilerplate": true, | 159 "_CloneShallowLiteralBoilerplate": true, |
| 160 "CreateArrayLiteralBoilerplate": true, | 160 "_CreateArrayLiteralBoilerplate": true, |
| 161 "IS_VAR": true, | 161 "_IS_VAR": true, |
| 162 "ResolvePossiblyDirectEval": true, | 162 "_ResolvePossiblyDirectEval": true, |
| 163 "Log": true, | 163 "_Log": true, |
| 164 "DeclareGlobals": true, | 164 "_DeclareGlobals": true, |
| 165 | 165 |
| 166 "PromoteScheduledException": true, | 166 "_PromoteScheduledException": true, |
| 167 "DeleteHandleScopeExtensions": true, | 167 "_DeleteHandleScopeExtensions": true, |
| 168 | 168 |
| 169 // Vararg with minimum number > 0. | 169 // Vararg with minimum number > 0. |
| 170 "Call": true, | 170 "_Call": true, |
| 171 | 171 |
| 172 // Requires integer arguments to be non-negative. | 172 // Requires integer arguments to be non-negative. |
| 173 "Apply": true, | 173 "_Apply": true, |
| 174 | 174 |
| 175 // That can only be invoked on Array.prototype. | 175 // That can only be invoked on Array.prototype. |
| 176 "FinishArrayPrototypeSetup": true, | 176 "_FinishArrayPrototypeSetup": true, |
| 177 | 177 |
| 178 "_SwapElements": true, | 178 "__SwapElements": true, |
| 179 | 179 |
| 180 // Performance critical functions which cannot afford type checks. | 180 // Performance critical functions which cannot afford type checks. |
| 181 "_IsNativeOrStrictMode": true, | 181 "__IsNativeOrStrictMode": true, |
| 182 "_CallFunction": true, | 182 "__CallFunction": true, |
| 183 | 183 |
| 184 // Tries to allocate based on argument, and (correctly) throws | 184 // Tries to allocate based on argument, and (correctly) throws |
| 185 // out-of-memory if the request is too large. In practice, the | 185 // out-of-memory if the request is too large. In practice, the |
| 186 // size will be the number of captures of a RegExp. | 186 // size will be the number of captures of a RegExp. |
| 187 "RegExpConstructResult": true, | |
| 188 "_RegExpConstructResult": true, | 187 "_RegExpConstructResult": true, |
| 188 "__RegExpConstructResult": true, |
| 189 | 189 |
| 190 // This functions perform some checks compile time (they require one of their | 190 // This functions perform some checks compile time (they require one of their |
| 191 // arguments to be a compile time smi). | 191 // arguments to be a compile time smi). |
| 192 "_DateField": true, | 192 "__DateField": true, |
| 193 "_GetFromCache": true, | 193 "__GetFromCache": true, |
| 194 | 194 |
| 195 // This function expects its first argument to be a non-smi. | 195 // This function expects its first argument to be a non-smi. |
| 196 "_IsStringWrapperSafeForDefaultValueOf" : true, | 196 "__IsStringWrapperSafeForDefaultValueOf" : true, |
| 197 | 197 |
| 198 // Only applicable to strings. | 198 // Only applicable to strings. |
| 199 "_HasCachedArrayIndex": true, | 199 "__HasCachedArrayIndex": true, |
| 200 "_GetCachedArrayIndex": true, | 200 "__GetCachedArrayIndex": true, |
| 201 "_OneByteSeqStringSetChar": true, | 201 "__OneByteSeqStringSetChar": true, |
| 202 "_TwoByteSeqStringSetChar": true, | 202 "__TwoByteSeqStringSetChar": true, |
| 203 | 203 |
| 204 // Only for debugging parallel recompilation. | 204 // Only for debugging parallel recompilation. |
| 205 "InstallRecompiledCode": true, | 205 "_InstallRecompiledCode": true, |
| 206 "ForceParallelRecompile": true | 206 "_ForceParallelRecompile": true |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 var currentlyUncallable = { | 209 var currentlyUncallable = { |
| 210 // We need to find a way to test this without breaking the system. | 210 // We need to find a way to test this without breaking the system. |
| 211 "SystemBreak": true | 211 "_SystemBreak": true |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 function testNatives() { | 214 function testNatives() { |
| 215 var allNatives = %ListNatives(); | 215 var allNatives = %ListNatives(); |
| 216 var start = 0; | 216 var start = 0; |
| 217 var stop = (allNatives.length >> 2); | 217 var stop = (allNatives.length >> 2); |
| 218 for (var i = start; i < stop; i++) { | 218 for (var i = start; i < stop; i++) { |
| 219 var nativeInfo = allNatives[i]; | 219 var nativeInfo = allNatives[i]; |
| 220 var name = nativeInfo[0]; | 220 var name = nativeInfo[0]; |
| 221 if (name in knownProblems || name in currentlyUncallable) | 221 if (name in knownProblems || name in currentlyUncallable) |
| 222 continue; | 222 continue; |
| 223 print(name); | 223 print(name); |
| 224 var argc = nativeInfo[1]; | 224 var argc = nativeInfo[1]; |
| 225 testArgumentCount(name, argc); | 225 testArgumentCount(name, argc); |
| 226 testArgumentTypes(name, argc); | 226 testArgumentTypes(name, argc); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 testNatives(); | 230 testNatives(); |
| OLD | NEW |