Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: src/runtime.cc

Issue 5980006: Misc debugger enhancements and bug fixes.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/debug-debugger.js ('K') | « src/runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 6117)
+++ src/runtime.cc (working copy)
@@ -10727,6 +10727,36 @@
}
+#ifdef ENABLE_DEBUGGER_SUPPORT
Søren Thygesen Gjesse 2011/01/03 08:56:07 I think there is a long section above guarded with
marklam 2011/01/04 20:12:13 Done.
+// Sets a v8 flag.
+static MaybeObject* Runtime_SetFlag(Arguments args) {
Søren Thygesen Gjesse 2011/01/03 08:56:07 Please change name to plural.
marklam 2011/01/04 20:12:13 Done.
+ CONVERT_CHECKED(String, arg, args[0]);
+ SmartPointer<char> flags =
+ arg->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
+ FlagList::SetFlagsFromString(*flags, strlen(*flags));
+ return Heap::undefined_value();
+}
+
+
+// Performs a GC.
+// Presently, it only does a full GC.
+static MaybeObject* Runtime_DoGC(Arguments args) {
Søren Thygesen Gjesse 2011/01/03 08:56:07 How about CollectGarbage (or just GC) instead of D
marklam 2011/01/04 20:12:13 Done.
+ Heap::CollectAllGarbage(true);
+ return Heap::undefined_value();
+}
+
+
+// Gets the current heap usage.
+static MaybeObject* Runtime_GetHeapUsage(Arguments args) {
+ int usage = Heap::SizeOfObjects();
+ if (!Smi::IsValid(usage)) {
+ return *Factory::NewNumberFromInt(usage);
+ }
+ return Smi::FromInt(usage);
+}
+#endif // ENABLE_DEBUGGER_SUPPORT
+
+
// ----------------------------------------------------------------------------
// Implementation of Runtime
« src/debug-debugger.js ('K') | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698