Backed out changeset c54bb9df733b (bug 1072906)

This commit is contained in:
Carsten "Tomcat" Book committed 2014-11-21 08:04:05 +01:00
1 parent 474fa50f2e
commit 1074985305
5 files changed
+9 -82

No files matched your search

-1
View File
@@ -313,7 +313,6 @@ if CONFIG['ENABLE_TRACE_LOGGING']:
SOURCES += [
'vm/TraceLogging.cpp',
'vm/TraceLoggingGraph.cpp',
'vm/TraceLoggingTypes.cpp',
]
if not CONFIG['ENABLE_ION']:
+8 -56
View File
@@ -3772,68 +3772,20 @@ Debugger::makeGlobalObjectReference(JSContext *cx, unsigned argc, Value *vp)
}
bool
Debugger::setupTraceLogger(JSContext *cx, unsigned argc, Value *vp)
Debugger::enableTraceItem(JSContext *cx, unsigned argc, Value *vp)
{
THIS_DEBUGGER(cx, argc, vp, "setupTraceLogger", args, dbg);
if (!args.requireAtLeast(cx, "Debugger.setupTraceLogger", 1))
THIS_DEBUGGER(cx, argc, vp, "enableTraceItem", args, dbg);
if (!args.requireAtLeast(cx, "Debugger.enableTraceItem", 1))
return false;
RootedObject obj(cx, ToObject(cx, args[0]));
if (!obj)
return false;
uint32_t id = args[0].toInt32();
AutoIdVector ids(cx);
if (!GetPropertyKeys(cx, obj, JSITER_OWNONLY, &ids))
return false;
if (ids.length() == 0) {
args.rval().setBoolean(true);
if (!TLTextIdIsToggable(id)) {
args.rval().setBoolean(false);
return true;
}
Vector<uint32_t> textIds(cx);
if (!textIds.reserve(ids.length()))
return false;
Vector<bool> values(cx);
if (!values.reserve(ids.length()))
return false;
for (size_t i = 0; i < ids.length(); i++) {
if (!JSID_IS_STRING(ids[i])) {
args.rval().setBoolean(false);
return true;
}
JSString *id = JSID_TO_STRING(ids[i]);
JSLinearString *linear = id->ensureLinear(cx);
if (!linear)
return false;
uint32_t textId = TLStringToTextId(linear);
if (!TLTextIdIsToggable(textId)) {
args.rval().setBoolean(false);
return true;
}
RootedValue v(cx);
if (!JSObject::getGeneric(cx, obj, obj, ids[i], &v))
return false;
textIds.append(textId);
values.append(ToBoolean(v));
}
MOZ_ASSERT(ids.length() == textIds.length());
MOZ_ASSERT(textIds.length() == values.length());
for (size_t i = 0; i < textIds.length(); i++) {
if (values[i])
TraceLogEnableTextId(cx, textIds[i]);
else
TraceLogDisableTextId(cx, textIds[i]);
}
TraceLogEnableTextId(cx, id);
args.rval().setBoolean(true);
return true;
@@ -3868,7 +3820,7 @@ const JSFunctionSpec Debugger::methods[] = {
JS_FN("findObjects", Debugger::findObjects, 1, 0),
JS_FN("findAllGlobals", Debugger::findAllGlobals, 0, 0),
JS_FN("makeGlobalObjectReference", Debugger::makeGlobalObjectReference, 1, 0),
JS_FN("setupTraceLogger", Debugger::setupTraceLogger, 1, 0),
JS_FN("enableTraceItem", Debugger::enableTraceItem, 1, 0),
JS_FS_END
};
+1 -1
View File
@@ -394,7 +394,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger>
static bool findObjects(JSContext *cx, unsigned argc, Value *vp);
static bool findAllGlobals(JSContext *cx, unsigned argc, Value *vp);
static bool makeGlobalObjectReference(JSContext *cx, unsigned argc, Value *vp);
static bool setupTraceLogger(JSContext *cx, unsigned argc, Value *vp);
static bool enableTraceItem(JSContext *cx, unsigned argc, Value *vp);
static bool construct(JSContext *cx, unsigned argc, Value *vp);
static const JSPropertySpec properties[];
static const JSFunctionSpec methods[];
-20
View File
@@ -1,20 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* 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/. */
#include "vm/TraceLoggingTypes.h"
class JSLinearString;
uint32_t
TLStringToTextId(JSLinearString *str)
{
#define NAME(textId) if (js::StringEqualsAscii(str, #textId)) return TraceLogger_ ## textId;
TRACELOGGER_TREE_ITEMS(NAME)
TRACELOGGER_LOG_ITEMS(NAME)
#undef NAME
return TraceLogger_Error;
}
-4
View File
@@ -8,7 +8,6 @@
#define TraceLoggingTypes_h
#include "jsalloc.h"
#include "jsstr.h"
#define TRACELOGGER_TREE_ITEMS(_) \
_(Baseline) \
@@ -89,9 +88,6 @@ TLTextIdString(TraceLoggerTextId id)
}
}
uint32_t
TLStringToTextId(JSLinearString *str);
inline bool
TLTextIdIsToggable(uint32_t id)
{