RAPL

Check-in [81e5d79a04]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fixes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:81e5d79a04e2292fe11bef749e227ccc2563e100
User & Date: arnulf 2012-02-22 20:50:03
Context
2012-02-22
20:52
code for new command ::itcl::delete and fixes check-in: 3cc9889cac user: arnulf tags: trunk
20:50
fixes check-in: 81e5d79a04 user: arnulf tags: trunk
20:47
fix for source command to return correct return value and fix for time command check-in: 2daa2c733a user: arnulf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rapl_itcl_obj_type.js.

299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
      }
      var opt_info = new R.ItclOption(itcl.interp, protection, kind_val, my_name, class_info);
      if (opt_info == itcl.interp.empty_obj) {
        return itcl.ERROR;
      }
      if (opt_info.storeOptionInfo(args.slice(i)) != itcl.OK) {
          return itcl.ERROR;
        }
      itcl.interp.curr_class_info.options[itcl.escape_key(opt_info.option_name)] = opt_info;
      break;
    case itcl.ITCL_COMPONENT:
    case itcl.ITCL_TYPE_COMPONENT:
      if (typeof itcl.interp.curr_class_info.components[itcl.escape_key(my_name)] != "undefined") {
        itcl.interp.setResultString(kind+" "+my_name+" is already defined for "+itcl.getItclClassTypeString(class_info.class_type)+" \""+class_info.class_name+"\"");
        return itcl.ERROR;







|







299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
      }
      var opt_info = new R.ItclOption(itcl.interp, protection, kind_val, my_name, class_info);
      if (opt_info == itcl.interp.empty_obj) {
        return itcl.ERROR;
      }
      if (opt_info.storeOptionInfo(args.slice(i)) != itcl.OK) {
          return itcl.ERROR;
      }
      itcl.interp.curr_class_info.options[itcl.escape_key(opt_info.option_name)] = opt_info;
      break;
    case itcl.ITCL_COMPONENT:
    case itcl.ITCL_TYPE_COMPONENT:
      if (typeof itcl.interp.curr_class_info.components[itcl.escape_key(my_name)] != "undefined") {
        itcl.interp.setResultString(kind+" "+my_name+" is already defined for "+itcl.getItclClassTypeString(class_info.class_type)+" \""+class_info.class_name+"\"");
        return itcl.ERROR;

Changes to rapl_pkg_corecmd.js.

1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369


1370
1371
1372
1373
1374
1375
1376
....
1377
1378
1379
1380
1381
1382
1383
1384



1385
1386
1387
1388

1389

1390
1391
1392
1393
1394
1395
1396
1397
    }
    if (script && script.getString() == "-") {
        interp.setResultFormatted("no body specified for pattern \"%#s\"", case_list[i - 2]);
        return interp.ERROR;
    }
    interp.setEmptyResult();
    if (script) {
      var retval = interp.eval_statement.evalObj(script);
      return retval;
    }
    return interp.OK;
  });

  /* ==================== sec_msec ===================================== */
  function sec_msec () {
    var t = new Date();
    return t.getSeconds()*1000 + t.getMilliseconds();
  }

  /* ==================== command time ===================================== */
  interp.registerCommand("::time", function (interp, args) {


    if ((args.length != 2) && (args.length != 3)) {
      interp.wrongNumArgs(interp, 1, args, "command ?count?");
      return interp.ERROR;
    }
    var code = args[1];
    if (args.length > 2) {
      var n = args[2];
................................................................................
    } else {
      var n = 1;
    }
    var t0 = sec_msec();
//var xx = interp.string_obj_type.newStringObj("10", -1);
//var yy = interp.string_obj_type.newStringObj("a", -1);
    for(var i = 0; i < n; i++) {
      var retval = interp.eval_statement.evalObj(code);



//        interp.setVar("a", xx);
//        interp.variable_obj_type.setVariable(yy, xx);
    }
//print("TT!"+((sec_msec()-t0)*1000/n + " microseconds per iteration")+"!");

    interp.setResult(interp.string_obj_type.newStringObj((sec_msec()-t0)*1000/n + " microseconds per iteration", -1));

    return interp.OK;
  });

  /* ==================== command uplevel ===================================== */
  interp.registerCommand("::uplevel", function (interp, args) {
//print("uplevel!"+args+"!");
    if (args.length >= 2) {
      var retcode;







|
<












>
>







 







|
>
>
>




>
|
>
|







1349
1350
1351
1352
1353
1354
1355
1356

1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
....
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
    }
    if (script && script.getString() == "-") {
        interp.setResultFormatted("no body specified for pattern \"%#s\"", case_list[i - 2]);
        return interp.ERROR;
    }
    interp.setEmptyResult();
    if (script) {
      return interp.eval_statement.evalObj(script);

    }
    return interp.OK;
  });

  /* ==================== sec_msec ===================================== */
  function sec_msec () {
    var t = new Date();
    return t.getSeconds()*1000 + t.getMilliseconds();
  }

  /* ==================== command time ===================================== */
  interp.registerCommand("::time", function (interp, args) {
    var ret_code = interp.OK;;

    if ((args.length != 2) && (args.length != 3)) {
      interp.wrongNumArgs(interp, 1, args, "command ?count?");
      return interp.ERROR;
    }
    var code = args[1];
    if (args.length > 2) {
      var n = args[2];
................................................................................
    } else {
      var n = 1;
    }
    var t0 = sec_msec();
//var xx = interp.string_obj_type.newStringObj("10", -1);
//var yy = interp.string_obj_type.newStringObj("a", -1);
    for(var i = 0; i < n; i++) {
      ret_code = interp.eval_statement.evalObj(code);
      if (ret_code != interp.OK) {
        break;
      }
//        interp.setVar("a", xx);
//        interp.variable_obj_type.setVariable(yy, xx);
    }
//print("TT!"+((sec_msec()-t0)*1000/n + " microseconds per iteration")+"!");
    if (ret_code == interp.OK) {
      interp.setResult(interp.string_obj_type.newStringObj((sec_msec()-t0)*1000/n + " microseconds per iteration", -1));
    }
    return ret_code;
  });

  /* ==================== command uplevel ===================================== */
  interp.registerCommand("::uplevel", function (interp, args) {
//print("uplevel!"+args+"!");
    if (args.length >= 2) {
      var retcode;