Commit 5da9e756 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Remove support for Live Object List and inspector module.

These were introduced in r7012 and r6379.
The reason for this is that both features are not being maintained.
They have been out-of-date for a while.  Test cases do not exist.

R=mstarzinger@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11975012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e3c3c162
......@@ -83,10 +83,6 @@ endif
ifeq ($(gdbjit), on)
GYPFLAGS += -Dv8_enable_gdbjit=1
endif
# liveobjectlist=on
ifeq ($(liveobjectlist), on)
GYPFLAGS += -Dv8_use_liveobjectlist=true
endif
# vfp2=off
ifeq ($(vfp2), off)
GYPFLAGS += -Dv8_can_use_vfp2_instructions=false
......
......@@ -67,16 +67,9 @@ LIBRARY_FLAGS = {
'debuggersupport:on': {
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'],
},
'inspector:on': {
'CPPDEFINES': ['INSPECTOR'],
},
'fasttls:off': {
'CPPDEFINES': ['V8_NO_FAST_TLS'],
},
'liveobjectlist:on': {
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR',
'LIVE_OBJECT_LIST', 'OBJECT_PRINT'],
}
},
'gcc': {
'all': {
......@@ -1051,16 +1044,6 @@ SIMPLE_OPTIONS = {
'default': 'on',
'help': 'enable debugging of JavaScript code'
},
'inspector': {
'values': ['on', 'off'],
'default': 'off',
'help': 'enable inspector features'
},
'liveobjectlist': {
'values': ['on', 'off'],
'default': 'off',
'help': 'enable live object list features in the debugger'
},
'soname': {
'values': ['on', 'off'],
'default': 'off',
......@@ -1418,13 +1401,6 @@ def PostprocessOptions(options, os):
options['msvcltcg'] = 'on'
if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'):
options['mipsabi'] = 'none'
if options['liveobjectlist'] == 'on':
if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'):
# Print a warning that liveobjectlist will implicitly enable the debugger
print "Warning: forcing debuggersupport on for liveobjectlist"
options['debuggersupport'] = 'on'
options['inspector'] = 'on'
options['objectprint'] = 'on'
def ParseEnvOverrides(arg, imports):
......
......@@ -92,7 +92,6 @@
'v8_use_snapshot%': 'true',
'host_os%': '<(OS)',
'v8_use_liveobjectlist%': 'false',
'werror%': '-Werror',
# With post mortem support enabled, metadata is embedded into libv8 that
......@@ -257,14 +256,6 @@
},
'msvs_configuration_platform': 'x64',
}], # v8_target_arch=="x64"
['v8_use_liveobjectlist=="true"', {
'defines': [
'ENABLE_DEBUGGER_SUPPORT',
'INSPECTOR',
'OBJECT_PRINT',
'LIVEOBJECTLIST',
],
}],
['v8_compress_startup_data=="bz2"', {
'defines': [
'COMPRESS_STARTUP_DATA_BZ2',
......
......@@ -89,7 +89,6 @@ SOURCES = {
hydrogen.cc
ic.cc
incremental-marking.cc
inspector.cc
interface.cc
interpreter-irregexp.cc
isolate.cc
......@@ -97,7 +96,6 @@ SOURCES = {
lithium-allocator.cc
lithium.cc
liveedit.cc
liveobjectlist.cc
log-utils.cc
log.cc
mark-compact.cc
......
......@@ -1235,12 +1235,6 @@ Handle<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
global_template->Set(String::New("Uint8ClampedArray"),
CreateArrayTemplate(Uint8ClampedArray), attr);
#ifdef LIVE_OBJECT_LIST
global_template->Set(String::New("lol_is_enabled"), True());
#else
global_template->Set(String::New("lol_is_enabled"), False());
#endif
#if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64)
Handle<ObjectTemplate> os_templ = ObjectTemplate::New();
AddOSMethods(os_templ);
......
This diff is collapsed.
......@@ -110,7 +110,6 @@ var debugger_flags = {
}
},
};
var lol_is_enabled = %HasLOLEnabled();
// Create a new break point object and add it to the list of break points.
......@@ -1437,8 +1436,6 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(
this.setVariableValueRequest_(request, response);
} else if (request.command == 'evaluate') {
this.evaluateRequest_(request, response);
} else if (lol_is_enabled && request.command == 'getobj') {
this.getobjRequest_(request, response);
} else if (request.command == 'lookup') {
this.lookupRequest_(request, response);
} else if (request.command == 'references') {
......@@ -1468,28 +1465,6 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(
} else if (request.command == 'gc') {
this.gcRequest_(request, response);
// LiveObjectList tools:
} else if (lol_is_enabled && request.command == 'lol-capture') {
this.lolCaptureRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-delete') {
this.lolDeleteRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-diff') {
this.lolDiffRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-getid') {
this.lolGetIdRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-info') {
this.lolInfoRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-reset') {
this.lolResetRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-retainers') {
this.lolRetainersRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-path') {
this.lolPathRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-print') {
this.lolPrintRequest_(request, response);
} else if (lol_is_enabled && request.command == 'lol-stats') {
this.lolStatsRequest_(request, response);
} else {
throw new Error('Unknown command "' + request.command + '" in request');
}
......@@ -2191,24 +2166,6 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
};
DebugCommandProcessor.prototype.getobjRequest_ = function(request, response) {
if (!request.arguments) {
return response.failed('Missing arguments');
}
// Pull out arguments.
var obj_id = request.arguments.obj_id;
// Check for legal arguments.
if (IS_UNDEFINED(obj_id)) {
return response.failed('Argument "obj_id" missing');
}
// Dump the object.
response.body = MakeMirror(%GetLOLObj(obj_id));
};
DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) {
if (!request.arguments) {
return response.failed('Missing arguments');
......@@ -2567,86 +2524,6 @@ DebugCommandProcessor.prototype.gcRequest_ = function(request, response) {
};
DebugCommandProcessor.prototype.lolCaptureRequest_ =
function(request, response) {
response.body = %CaptureLOL();
};
DebugCommandProcessor.prototype.lolDeleteRequest_ =
function(request, response) {
var id = request.arguments.id;
var result = %DeleteLOL(id);
if (result) {
response.body = { id: id };
} else {
response.failed('Failed to delete: live object list ' + id + ' not found.');
}
};
DebugCommandProcessor.prototype.lolDiffRequest_ = function(request, response) {
var id1 = request.arguments.id1;
var id2 = request.arguments.id2;
var verbose = request.arguments.verbose;
var filter = request.arguments.filter;
if (verbose === true) {
var start = request.arguments.start;
var count = request.arguments.count;
response.body = %DumpLOL(id1, id2, start, count, filter);
} else {
response.body = %SummarizeLOL(id1, id2, filter);
}
};
DebugCommandProcessor.prototype.lolGetIdRequest_ = function(request, response) {
var address = request.arguments.address;
response.body = {};
response.body.id = %GetLOLObjId(address);
};
DebugCommandProcessor.prototype.lolInfoRequest_ = function(request, response) {
var start = request.arguments.start;
var count = request.arguments.count;
response.body = %InfoLOL(start, count);
};
DebugCommandProcessor.prototype.lolResetRequest_ = function(request, response) {
%ResetLOL();
};
DebugCommandProcessor.prototype.lolRetainersRequest_ =
function(request, response) {
var id = request.arguments.id;
var verbose = request.arguments.verbose;
var start = request.arguments.start;
var count = request.arguments.count;
var filter = request.arguments.filter;
response.body = %GetLOLObjRetainers(id, Mirror.prototype, verbose,
start, count, filter);
};
DebugCommandProcessor.prototype.lolPathRequest_ = function(request, response) {
var id1 = request.arguments.id1;
var id2 = request.arguments.id2;
response.body = {};
response.body.path = %GetLOLPath(id1, id2, Mirror.prototype);
};
DebugCommandProcessor.prototype.lolPrintRequest_ = function(request, response) {
var id = request.arguments.id;
response.body = {};
response.body.dump = %PrintLOLObj(id);
};
// Check whether the previously processed command caused the VM to become
// running.
DebugCommandProcessor.prototype.isRunning = function() {
......
......@@ -419,12 +419,6 @@ DEFINE_bool(use_idle_notification, true,
// ic.cc
DEFINE_bool(use_ic, true, "use inline caching")
#ifdef LIVE_OBJECT_LIST
// liveobjectlist.cc
DEFINE_string(lol_workdir, NULL, "path for lol temp files")
DEFINE_bool(verify_lol, false, "perform debugging verification for lol")
#endif
// macro-assembler-ia32.cc
DEFINE_bool(native_code_counters, false,
"generate extra code for manipulating stats counters")
......
......@@ -37,7 +37,6 @@
#include "global-handles.h"
#include "heap-profiler.h"
#include "incremental-marking.h"
#include "liveobjectlist-inl.h"
#include "mark-compact.h"
#include "natives.h"
#include "objects-visiting.h"
......@@ -439,7 +438,6 @@ void Heap::GarbageCollectionPrologue() {
ReportStatisticsBeforeGC();
#endif // DEBUG
LiveObjectList::GCPrologue();
store_buffer()->GCPrologue();
}
......@@ -466,7 +464,6 @@ void Heap::RepairFreeListsAfterBoot() {
void Heap::GarbageCollectionEpilogue() {
store_buffer()->GCEpilogue();
LiveObjectList::GCEpilogue();
// In release mode, we only zap the from space under heap verification.
if (Heap::ShouldZapGarbage()) {
......@@ -1393,7 +1390,6 @@ void Heap::Scavenge() {
promotion_queue_.Destroy();
LiveObjectList::UpdateReferencesForScavengeGC();
if (!FLAG_watch_ic_patching) {
isolate()->runtime_profiler()->UpdateSamplesAfterScavenge();
}
......@@ -6748,7 +6744,7 @@ void HeapIterator::reset() {
}
#if defined(DEBUG) || defined(LIVE_OBJECT_LIST)
#ifdef DEBUG
Object* const PathTracer::kAnyGlobalObject = reinterpret_cast<Object*>(NULL);
......@@ -6915,10 +6911,8 @@ void PathTracer::ProcessResults() {
PrintF("=====================================\n");
}
}
#endif // DEBUG || LIVE_OBJECT_LIST
#ifdef DEBUG
// Triggers a depth-first traversal of reachable objects from one
// given root object and finds a path to a specific heap object and
// prints it.
......
......@@ -2840,7 +2840,7 @@ class IntrusiveMarking {
};
#if defined(DEBUG) || defined(LIVE_OBJECT_LIST)
#ifdef DEBUG
// Helper class for tracing paths to a search target Object from all roots.
// The TracePathFrom() method can be used to trace paths from a specific
// object to the search target object.
......@@ -2897,7 +2897,7 @@ class PathTracer : public ObjectVisitor {
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
};
#endif // DEBUG || LIVE_OBJECT_LIST
#endif // DEBUG
} } // namespace v8::internal
......
// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "v8.h"
#include "inspector.h"
namespace v8 {
namespace internal {
#ifdef INSPECTOR
//============================================================================
// The Inspector.
void Inspector::DumpObjectType(FILE* out, Object* obj, bool print_more) {
// Dump the object pointer.
OS::FPrint(out, "%p:", reinterpret_cast<void*>(obj));
if (obj->IsHeapObject()) {
HeapObject* hobj = HeapObject::cast(obj);
OS::FPrint(out, " size %d :", hobj->Size());
}
// Dump each object classification that matches this object.
#define FOR_EACH_TYPE(type) \
if (obj->Is##type()) { \
OS::FPrint(out, " %s", #type); \
}
OBJECT_TYPE_LIST(FOR_EACH_TYPE)
HEAP_OBJECT_TYPE_LIST(FOR_EACH_TYPE)
#undef FOR_EACH_TYPE
}
#endif // INSPECTOR
} } // namespace v8::internal
// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_INSPECTOR_H_
#define V8_INSPECTOR_H_
// Only build this code if we're configured with the INSPECTOR.
#ifdef INSPECTOR
#include "v8.h"
#include "objects.h"
namespace v8 {
namespace internal {
class Inspector {
public:
static void DumpObjectType(FILE* out, Object* obj, bool print_more);
static void DumpObjectType(FILE* out, Object* obj) {
DumpObjectType(out, obj, false);
}
static void DumpObjectType(Object* obj, bool print_more) {
DumpObjectType(stdout, obj, print_more);
}
static void DumpObjectType(Object* obj) {
DumpObjectType(stdout, obj, false);
}
};
} } // namespace v8::internal
#endif // INSPECTOR
#endif // V8_INSPECTOR_H_
// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_LIVEOBJECTLIST_INL_H_
#define V8_LIVEOBJECTLIST_INL_H_
#include "v8.h"
#include "liveobjectlist.h"
namespace v8 {
namespace internal {
#ifdef LIVE_OBJECT_LIST
void LiveObjectList::GCEpilogue() {
if (!NeedLOLProcessing()) return;
GCEpiloguePrivate();
}
void LiveObjectList::GCPrologue() {
if (!NeedLOLProcessing()) return;
#ifdef VERIFY_LOL
if (FLAG_verify_lol) {
Verify();
}
#endif
}
void LiveObjectList::IterateElements(ObjectVisitor* v) {
if (!NeedLOLProcessing()) return;
IterateElementsPrivate(v);
}
void LiveObjectList::ProcessNonLive(HeapObject* obj) {
// Only do work if we have at least one list to process.
if (last()) DoProcessNonLive(obj);
}
void LiveObjectList::UpdateReferencesForScavengeGC() {
if (LiveObjectList::NeedLOLProcessing()) {
UpdateLiveObjectListVisitor update_visitor;
LiveObjectList::IterateElements(&update_visitor);
}
}
LiveObjectList* LiveObjectList::FindLolForId(int id,
LiveObjectList* start_lol) {
if (id != 0) {
LiveObjectList* lol = start_lol;
while (lol != NULL) {
if (lol->id() == id) {
return lol;
}
lol = lol->prev_;
}
}
return NULL;
}
// Iterates the elements in every lol and returns the one that matches the
// specified key. If no matching element is found, then it returns NULL.
template <typename T>
inline LiveObjectList::Element*
LiveObjectList::FindElementFor(T (*GetValue)(LiveObjectList::Element*), T key) {
LiveObjectList* lol = last();
while (lol != NULL) {
Element* elements = lol->elements_;
for (int i = 0; i < lol->obj_count_; i++) {
Element* element = &elements[i];
if (GetValue(element) == key) {
return element;
}
}
lol = lol->prev_;
}
return NULL;
}
inline int LiveObjectList::GetElementId(LiveObjectList::Element* element) {
return element->id_;
}
inline HeapObject*
LiveObjectList::GetElementObj(LiveObjectList::Element* element) {
return element->obj_;
}
#endif // LIVE_OBJECT_LIST
} } // namespace v8::internal
#endif // V8_LIVEOBJECTLIST_INL_H_
This diff is collapsed.
This diff is collapsed.
......@@ -36,7 +36,6 @@
#include "heap-profiler.h"
#include "ic-inl.h"
#include "incremental-marking.h"
#include "liveobjectlist-inl.h"
#include "mark-compact.h"
#include "objects-visiting.h"
#include "objects-visiting-inl.h"
......@@ -2592,9 +2591,6 @@ void MarkCompactCollector::EvacuateNewSpace() {
size,
NEW_SPACE);
} else {
// Process the dead object before we write a NULL into its header.
LiveObjectList::ProcessNonLive(object);
// Mark dead objects in the new space with null in their map field.
Memory::Address_at(object->address()) = NULL;
}
......@@ -2994,7 +2990,6 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
GCTracer::Scope::MC_UPDATE_ROOT_TO_NEW_POINTERS);
// Update roots.
heap_->IterateRoots(&updating_visitor, VISIT_ALL_IN_SWEEP_NEWSPACE);
LiveObjectList::IterateElements(&updating_visitor);
}
{ GCTracer::Scope gc_scope(tracer_,
......
......@@ -48,7 +48,6 @@
#include "json-parser.h"
#include "json-stringifier.h"
#include "liveedit.h"
#include "liveobjectlist-inl.h"
#include "misc-intrinsics.h"
#include "parser.h"
#include "platform.h"
......@@ -12977,206 +12976,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHeapUsage) {
return Smi::FromInt(usage);
}
// Captures a live object list from the present heap.
RUNTIME_FUNCTION(MaybeObject*, Runtime_HasLOLEnabled) {
#ifdef LIVE_OBJECT_LIST
return isolate->heap()->true_value();
#else
return isolate->heap()->false_value();
#endif
}
// Captures a live object list from the present heap.
RUNTIME_FUNCTION(MaybeObject*, Runtime_CaptureLOL) {
#ifdef LIVE_OBJECT_LIST
return LiveObjectList::Capture();
#else
return isolate->heap()->undefined_value();
#endif
}
// Deletes the specified live object list.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteLOL) {
#ifdef LIVE_OBJECT_LIST
CONVERT_SMI_ARG_CHECKED(id, 0);
bool success = LiveObjectList::Delete(id);
return isolate->heap()->ToBoolean(success);
#else
return isolate->heap()->undefined_value();
#endif
}
// Generates the response to a debugger request for a dump of the objects
// contained in the difference between the captured live object lists
// specified by id1 and id2.
// If id1 is 0 (i.e. not a valid lol), then the whole of lol id2 will be
// dumped.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DumpLOL) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_SMI_ARG_CHECKED(id1, 0);
CONVERT_SMI_ARG_CHECKED(id2, 1);
CONVERT_SMI_ARG_CHECKED(start, 2);
CONVERT_SMI_ARG_CHECKED(count, 3);
CONVERT_ARG_HANDLE_CHECKED(JSObject, filter_obj, 4);
EnterDebugger enter_debugger;
return LiveObjectList::Dump(id1, id2, start, count, filter_obj);
#else
return isolate->heap()->undefined_value();
#endif
}
// Gets the specified object as requested by the debugger.
// This is only used for obj ids shown in live object lists.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObj) {
#ifdef LIVE_OBJECT_LIST
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
Object* result = LiveObjectList::GetObj(obj_id);
return result;
#else
return isolate->heap()->undefined_value();
#endif
}
// Gets the obj id for the specified address if valid.
// This is only used for obj ids shown in live object lists.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjId) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_ARG_HANDLE_CHECKED(String, address, 0);
Object* result = LiveObjectList::GetObjId(address);
return result;
#else
return isolate->heap()->undefined_value();
#endif
}
// Gets the retainers that references the specified object alive.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLObjRetainers) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
RUNTIME_ASSERT(args[1]->IsUndefined() || args[1]->IsJSObject());
RUNTIME_ASSERT(args[2]->IsUndefined() || args[2]->IsBoolean());
RUNTIME_ASSERT(args[3]->IsUndefined() || args[3]->IsSmi());
RUNTIME_ASSERT(args[4]->IsUndefined() || args[4]->IsSmi());
CONVERT_ARG_HANDLE_CHECKED(JSObject, filter_obj, 5);
Handle<JSObject> instance_filter;
if (args[1]->IsJSObject()) {
instance_filter = args.at<JSObject>(1);
}
bool verbose = false;
if (args[2]->IsBoolean()) {
verbose = args[2]->IsTrue();
}
int start = 0;
if (args[3]->IsSmi()) {
start = args.smi_at(3);
}
int limit = Smi::kMaxValue;
if (args[4]->IsSmi()) {
limit = args.smi_at(4);
}
return LiveObjectList::GetObjRetainers(obj_id,
instance_filter,
verbose,
start,
limit,
filter_obj);
#else
return isolate->heap()->undefined_value();
#endif
}
// Gets the reference path between 2 objects.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetLOLPath) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_SMI_ARG_CHECKED(obj_id1, 0);
CONVERT_SMI_ARG_CHECKED(obj_id2, 1);
RUNTIME_ASSERT(args[2]->IsUndefined() || args[2]->IsJSObject());
Handle<JSObject> instance_filter;
if (args[2]->IsJSObject()) {
instance_filter = args.at<JSObject>(2);
}
Object* result =
LiveObjectList::GetPath(obj_id1, obj_id2, instance_filter);
return result;
#else
return isolate->heap()->undefined_value();
#endif
}
// Generates the response to a debugger request for a list of all
// previously captured live object lists.
RUNTIME_FUNCTION(MaybeObject*, Runtime_InfoLOL) {
#ifdef LIVE_OBJECT_LIST
CONVERT_SMI_ARG_CHECKED(start, 0);
CONVERT_SMI_ARG_CHECKED(count, 1);
return LiveObjectList::Info(start, count);
#else
return isolate->heap()->undefined_value();
#endif
}
// Gets a dump of the specified object as requested by the debugger.
// This is only used for obj ids shown in live object lists.
RUNTIME_FUNCTION(MaybeObject*, Runtime_PrintLOLObj) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_SMI_ARG_CHECKED(obj_id, 0);
Object* result = LiveObjectList::PrintObj(obj_id);
return result;
#else
return isolate->heap()->undefined_value();
#endif
}
// Resets and releases all previously captured live object lists.
RUNTIME_FUNCTION(MaybeObject*, Runtime_ResetLOL) {
#ifdef LIVE_OBJECT_LIST
LiveObjectList::Reset();
return isolate->heap()->undefined_value();
#else
return isolate->heap()->undefined_value();
#endif
}
// Generates the response to a debugger request for a summary of the types
// of objects in the difference between the captured live object lists
// specified by id1 and id2.
// If id1 is 0 (i.e. not a valid lol), then the whole of lol id2 will be
// summarized.
RUNTIME_FUNCTION(MaybeObject*, Runtime_SummarizeLOL) {
#ifdef LIVE_OBJECT_LIST
HandleScope scope;
CONVERT_SMI_ARG_CHECKED(id1, 0);
CONVERT_SMI_ARG_CHECKED(id2, 1);
CONVERT_ARG_HANDLE_CHECKED(JSObject, filter_obj, 2);
EnterDebugger enter_debugger;
return LiveObjectList::Summarize(id1, id2, filter_obj);
#else
return isolate->heap()->undefined_value();
#endif
}
#endif // ENABLE_DEBUGGER_SUPPORT
......
......@@ -478,20 +478,6 @@ namespace internal {
F(SetFlags, 1, 1) \
F(CollectGarbage, 1, 1) \
F(GetHeapUsage, 0, 1) \
\
/* LiveObjectList support*/ \
F(HasLOLEnabled, 0, 1) \
F(CaptureLOL, 0, 1) \
F(DeleteLOL, 1, 1) \
F(DumpLOL, 5, 1) \
F(GetLOLObj, 1, 1) \
F(GetLOLObjId, 1, 1) \
F(GetLOLObjRetainers, 6, 1) \
F(GetLOLPath, 3, 1) \
F(InfoLOL, 2, 1) \
F(PrintLOLObj, 1, 1) \
F(ResetLOL, 0, 1) \
F(SummarizeLOL, 3, 1)
#else
#define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
......
......@@ -27,7 +27,6 @@
#include "v8.h"
#include "liveobjectlist-inl.h"
#include "macro-assembler.h"
#include "mark-compact.h"
#include "platform.h"
......
......@@ -273,46 +273,4 @@ void StringBuilder::AddFormattedList(const char* format, va_list list) {
}
}
MemoryMappedExternalResource::MemoryMappedExternalResource(const char* filename)
: filename_(NULL),
data_(NULL),
length_(0),
remove_file_on_cleanup_(false) {
Init(filename);
}
MemoryMappedExternalResource::
MemoryMappedExternalResource(const char* filename,
bool remove_file_on_cleanup)
: filename_(NULL),
data_(NULL),
length_(0),
remove_file_on_cleanup_(remove_file_on_cleanup) {
Init(filename);
}
MemoryMappedExternalResource::~MemoryMappedExternalResource() {
// Release the resources if we had successfully acquired them:
if (file_ != NULL) {
delete file_;
if (remove_file_on_cleanup_) {
OS::Remove(filename_);
}
DeleteArray<char>(filename_);
}
}
void MemoryMappedExternalResource::Init(const char* filename) {
file_ = OS::MemoryMappedFile::open(filename);
if (file_ != NULL) {
filename_ = StrDup(filename);
data_ = reinterpret_cast<char*>(file_->memory());
length_ = file_->size();
}
}
} } // namespace v8::internal
......@@ -264,33 +264,6 @@ void CopyCharsUnsigned(sinkchar* dest, const sourcechar* src, int chars) {
}
// A resource for using mmapped files to back external strings that are read
// from files.
class MemoryMappedExternalResource: public
v8::String::ExternalAsciiStringResource {
public:
explicit MemoryMappedExternalResource(const char* filename);
MemoryMappedExternalResource(const char* filename,
bool remove_file_on_cleanup);
virtual ~MemoryMappedExternalResource();
virtual const char* data() const { return data_; }
virtual size_t length() const { return length_; }
bool exists() const { return file_ != NULL; }
bool is_empty() const { return length_ == 0; }
private:
void Init(const char* filename);
char* filename_;
OS::MemoryMappedFile* file_;
const char* data_;
size_t length_;
bool remove_file_on_cleanup_;
};
class StringBuilder : public SimpleStringBuilder {
public:
explicit StringBuilder(int size) : SimpleStringBuilder(size) { }
......
......@@ -353,8 +353,6 @@
'../../src/ic.h',
'../../src/incremental-marking.cc',
'../../src/incremental-marking.h',
'../../src/inspector.cc',
'../../src/inspector.h',
'../../src/interface.cc',
'../../src/interface.h',
'../../src/interpreter-irregexp.cc',
......@@ -375,9 +373,6 @@
'../../src/lithium.h',
'../../src/liveedit.cc',
'../../src/liveedit.h',
'../../src/liveobjectlist-inl.h',
'../../src/liveobjectlist.cc',
'../../src/liveobjectlist.h',
'../../src/log-inl.h',
'../../src/log-utils.cc',
'../../src/log-utils.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment