author | Jeff Walden <jwalden@mit.edu> |
Tue, 03 Dec 2013 15:53:40 -0800 | |
changeset 158688 | 5036242b2d531d76027470bd07f0add17659321d |
parent 158687 | 4856e14d1d94169c7f09d08633e7f2214b93de23 |
child 158689 | b96d513cd89f5aff1841c6a6c926481807864589 |
push id | 25752 |
push user | cbook@mozilla.com |
push date | Wed, 04 Dec 2013 08:35:03 +0000 |
treeherder | mozilla-central@8187818246ad [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mccr8 |
bugs | 937751 |
milestone | 28.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/public/SliceBudget.h | file | annotate | diff | comparison | revisions | |
js/src/jsgc.h | file | annotate | diff | comparison | revisions |
--- a/js/public/SliceBudget.h +++ b/js/public/SliceBudget.h @@ -2,25 +2,28 @@ * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef js_SliceBudget_h #define js_SliceBudget_h +#include <stdint.h> + namespace js { /* * This class records how much work has been done in a given collection slice, so that * we can return before pausing for too long. Some slices are allowed to run for * unlimited time, and others are bounded. To reduce the number of gettimeofday * calls, we only check the time every 1000 operations. */ -struct JS_PUBLIC_API(SliceBudget) { +struct JS_PUBLIC_API(SliceBudget) +{ int64_t deadline; /* in microseconds */ intptr_t counter; static const intptr_t CounterReset = 1000; static const int64_t Unlimited = 0; static int64_t TimeBudget(int64_t millis); static int64_t WorkBudget(int64_t work);
--- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -11,16 +11,17 @@ #include "mozilla/DebugOnly.h" #include "mozilla/MemoryReporting.h" #include "jslock.h" #include "jsobj.h" #include "js/GCAPI.h" +#include "js/SliceBudget.h" #include "js/Tracer.h" #include "js/Vector.h" class JSAtom; struct JSCompartment; class JSFlatString; class JSLinearString; @@ -34,17 +35,16 @@ class DebugScopeObject; class GCHelperThread; class GlobalObject; class LazyScript; class Nursery; class PropertyName; class ScopeObject; class Shape; class UnownedBaseShape; -struct SliceBudget; unsigned GetCPUCount(); enum HeapState { Idle, // doing nothing with the GC heap Tracing, // tracing the GC heap without collecting, e.g. IterateCompartments() MajorCollecting, // doing a GC of the major heap MinorCollecting // doing a GC of the minor heap (nursery)