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

Unified Diff: src/extensions/gc-extension.cc

Issue 143633007: A64: Synchronize with r18764. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months 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
« no previous file with comments | « src/extensions/gc-extension.h ('k') | src/extensions/statistics-extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/extensions/gc-extension.cc
diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc
index 205587f41cbf10e0f76efd01483b96042782cf8c..1d4873de73ed01d99a81d8a9bf6af3b90764a446 100644
--- a/src/extensions/gc-extension.cc
+++ b/src/extensions/gc-extension.cc
@@ -40,28 +40,9 @@ v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
void GCExtension::GC(const v8::FunctionCallbackInfo<v8::Value>& args) {
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate());
- if (args[0]->BooleanValue()) {
- isolate->heap()->CollectGarbage(
- NEW_SPACE, "gc extension", v8::kGCCallbackFlagForced);
- } else {
- isolate->heap()->CollectAllGarbage(
- Heap::kNoGCFlags, "gc extension", v8::kGCCallbackFlagForced);
- }
-}
-
-
-void GCExtension::Register() {
- static char buffer[50];
- Vector<char> temp_vector(buffer, sizeof(buffer));
- if (FLAG_expose_gc_as != NULL && strlen(FLAG_expose_gc_as) != 0) {
- OS::SNPrintF(temp_vector, "native function %s();", FLAG_expose_gc_as);
- } else {
- OS::SNPrintF(temp_vector, "native function gc();");
- }
-
- static GCExtension gc_extension(buffer);
- static v8::DeclareExtension declaration(&gc_extension);
+ args.GetIsolate()->RequestGarbageCollectionForTesting(
+ args[0]->BooleanValue() ? v8::Isolate::kMinorGarbageCollection
+ : v8::Isolate::kFullGarbageCollection);
}
} } // namespace v8::internal
« no previous file with comments | « src/extensions/gc-extension.h ('k') | src/extensions/statistics-extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698