| Index: src/runtime.cc
|
| ===================================================================
|
| --- src/runtime.cc (revision 12582)
|
| +++ src/runtime.cc (working copy)
|
| @@ -13100,6 +13100,46 @@
|
| }
|
|
|
|
|
| +RUNTIME_FUNCTION(MaybeObject*,
|
| + Runtime_GetShortTermEvalCompilationCacheStatistics) {
|
| + if (!FLAG_json_eval_cache) return isolate->heap()->undefined_value();
|
| + HandleScope scope(isolate);
|
| +
|
| + const int kValueCount = 4;
|
| + const char* keys[kValueCount] = { "entryCount",
|
| + "maxEntries",
|
| + "totalSize",
|
| + "maxTotalSize" };
|
| + int values[kValueCount];
|
| + isolate->compilation_cache()->GetShortTermEvalStatistics(&values[0],
|
| + &values[1],
|
| + &values[2],
|
| + &values[3]);
|
| +
|
| + Handle<JSObject> result =
|
| + isolate->factory()->NewJSObject(isolate->object_function());
|
| + PropertyAttributes attribs = NONE;
|
| +
|
| + for (int i = 0; i < kValueCount; i++) {
|
| + Handle<String> key =
|
| + isolate->factory()->LookupAsciiSymbol(CStrVector(keys[i]));
|
| + Handle<Object> value(Smi::FromInt(values[i]));
|
| + RETURN_IF_EMPTY_HANDLE(isolate,
|
| + SetProperty(result, key, value, attribs, kStrictMode));
|
| + }
|
| +
|
| + return *result;
|
| +}
|
| +
|
| +
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearShortTermCompilationCache) {
|
| + bool result = isolate->compilation_cache()->ClearShortTerm();
|
| + return result
|
| + ? isolate->heap()->true_value()
|
| + : isolate->heap()->false_value();
|
| +}
|
| +
|
| +
|
| #ifdef DEBUG
|
| // ListNatives is ONLY used by the fuzz-natives.js in debug mode
|
| // Exclude the code in release mode.
|
|
|