Changeset 15138
- Timestamp:
- 03/22/13 17:31:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r15129 r15138 148 148 TryCatch exception; 149 149 150 const Handle<Script> sleep = Script::Compile(String::New("v8.sleep();"), String::New("internal"));151 if (sleep.IsEmpty())152 return Undefined();150 //const Handle<Script> sleep = Script::Compile(String::New("v8.sleep();"), String::New("internal")); 151 //if (sleep.IsEmpty()) 152 // return Undefined(); 153 153 154 154 Handle<Function> func = Handle<Function>::Cast(args[1]); … … 171 171 // JavaScript ever now and then. This also allows us to catch 172 172 // exceptions, either from the preemption or ConvertEvent 173 sleep->Run(); 173 //sleep->Run(); 174 175 // Theoretically, the CPU usage can be reduced by maybe a factor 176 // of four using a larger value, but this also means that the 177 // JavaScript is locked for a longer time. 178 const Unlocker unlock; 179 usleep(1000); 174 180 } 175 181 … … 1214 1220 HandleScope handle_scope; 1215 1221 1216 const Handle<Script> sleep = Script::Compile(String::New("v8.sleep();"), String::New("internal"));1217 if (sleep.IsEmpty())1218 return Undefined();1222 //const Handle<Script> sleep = Script::Compile(String::New("v8.sleep();"), String::New("internal")); 1223 //if (sleep.IsEmpty()) 1224 // return Undefined(); 1219 1225 1220 1226 const Handle<String> data = String::New("data"); … … 1273 1279 // JavaScript ever now and then. This also allows us to catch 1274 1280 // exceptions, either from the preemption or ConvertEvent 1275 sleep->Run(); 1281 //sleep->Run(); 1282 1283 // Theoretically, the CPU usage can be reduced by maybe a factor 1284 // of four using a larger value, but this also means that the 1285 // JavaScript is locked for a longer time. 1286 const Unlocker unlock; 1287 usleep(1000); 1276 1288 } 1277 1289 … … 2215 2227 "{" 2216 2228 "return String.form(this, Array.prototype.slice.call(arguments));" 2229 "}" 2230 "\n" 2231 "String.prototype.count = function(c,i)" 2232 "{" 2233 "return (this.match(new RegExp(c,i?'gi':'g'))||[]).length;" 2217 2234 "}"/* 2218 2235 "\n"
Note:
See TracChangeset
for help on using the changeset viewer.