From 75cdc895ec8fd38b3a22535d9f90792c7c7be964 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Wed, 1 Mar 2017 12:52:10 +0100 Subject: [PATCH] benchmark: cleanup after forced optimization drop This removes all instances of %OptimizeFunctionOnNextCall from common.js and README.md PR-URL: https://github.com/nodejs/node/pull/9615 Reviewed-By: James M Snell Reviewed-By: Matteo Collina --- benchmark/README.md | 9 --------- benchmark/common.js | 14 -------------- 2 files changed, 23 deletions(-) diff --git a/benchmark/README.md b/benchmark/README.md index 6fd9a97bdfb3bb..17c733e6eb0b6c 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -235,12 +235,3 @@ it returns to accomplish what they need. This function reports timing data to the parent process (usually created by running `compare.js`, `run.js` or `scatter.js`). -### v8ForceOptimization(method[, ...args]) - -Force V8 to mark the `method` for optimization with the native function -`%OptimizeFunctionOnNextCall()` and return the optimization status -after that. - -It can be used to prevent the benchmark from getting disrupted by the optimizer -kicking in halfway through. However, this could result in a less effective -optimization. In general, only use it if you know what it actually does. diff --git a/benchmark/common.js b/benchmark/common.js index 6a9b2ba0f71681..7ce180fdb7ff0a 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -229,17 +229,3 @@ Benchmark.prototype.report = function(rate, elapsed) { type: 'report' }); }; - -exports.v8ForceOptimization = function(method) { - if (typeof method !== 'function') - return; - - const v8 = require('v8'); - v8.setFlagsFromString('--allow_natives_syntax'); - - const args = Array.prototype.slice.call(arguments, 1); - method.apply(null, args); - eval('%OptimizeFunctionOnNextCall(method)'); - method.apply(null, args); - return eval('%GetOptimizationStatus(method)'); -};