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 |