From d7050c24980a7f426af579818a8ac06ff916d80e Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Fri, 14 Mar 2014 10:54:28 -0600 Subject: [PATCH] fix benchmarks R=arv BUG= Review URL: https://codereview.appspot.com/76130043 --- benchmark/d8_benchmarks.js | 8 +------- src/observe.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/benchmark/d8_benchmarks.js b/benchmark/d8_benchmarks.js index 6cb93f1..9f131ae 100644 --- a/benchmark/d8_benchmarks.js +++ b/benchmark/d8_benchmarks.js @@ -12,13 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -/* - This is a harness so that the ChangeSummary benchmarks can be run and profiled - using V8's d8 shell. Doing requires modifying V8's src/object-observe.js to - expose full delivery of all pending changes to observers via - Object.deliverAllChangesRecords(). This is *not* a part of the spec and is - just a hack to allow profiling the benchmarks from d8. -*/ +// Flags: --allow-natives-syntax var console = { log: print diff --git a/src/observe.js b/src/observe.js index a797263..867744c 100644 --- a/src/observe.js +++ b/src/observe.js @@ -621,7 +621,14 @@ var runningMicrotaskCheckpoint = false; - var hasDebugForceFullDelivery = typeof Object.deliverAllChangeRecords == 'function'; + var hasDebugForceFullDelivery = hasObserve && (function() { + try { + eval('%RunMicrotasks()'); + return true; + } catch (ex) { + return false; + } + })(); global.Platform = global.Platform || {}; @@ -630,7 +637,7 @@ return; if (hasDebugForceFullDelivery) { - Object.deliverAllChangeRecords(); + eval('%RunMicrotasks()'); return; }