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

Side by Side Diff: src/api.cc

Issue 661458: Remove the deprecated context disposal GC heuristic. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 bool V8::IsGlobalWeak(i::Object** obj) { 431 bool V8::IsGlobalWeak(i::Object** obj) {
432 LOG_API("IsGlobalWeak"); 432 LOG_API("IsGlobalWeak");
433 if (!i::V8::IsRunning()) return false; 433 if (!i::V8::IsRunning()) return false;
434 return i::GlobalHandles::IsWeak(obj); 434 return i::GlobalHandles::IsWeak(obj);
435 } 435 }
436 436
437 437
438 void V8::DisposeGlobal(i::Object** obj) { 438 void V8::DisposeGlobal(i::Object** obj) {
439 LOG_API("DisposeGlobal"); 439 LOG_API("DisposeGlobal");
440 if (!i::V8::IsRunning()) return; 440 if (!i::V8::IsRunning()) return;
441 if ((*obj)->IsGlobalContext()) i::Heap::NotifyContextDisposedDeprecated();
442 i::GlobalHandles::Destroy(obj); 441 i::GlobalHandles::Destroy(obj);
443 } 442 }
444 443
445 // --- H a n d l e s --- 444 // --- H a n d l e s ---
446 445
447 446
448 HandleScope::HandleScope() : is_closed_(false) { 447 HandleScope::HandleScope() : is_closed_(false) {
449 API_ENTRY_CHECK("HandleScope::HandleScope"); 448 API_ENTRY_CHECK("HandleScope::HandleScope");
450 i::HandleScope::Enter(&previous_); 449 i::HandleScope::Enter(&previous_);
451 } 450 }
(...skipping 2428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 v8::Handle<ObjectTemplate> global_template, 2879 v8::Handle<ObjectTemplate> global_template,
2881 v8::Handle<Value> global_object) { 2880 v8::Handle<Value> global_object) {
2882 EnsureInitialized("v8::Context::New()"); 2881 EnsureInitialized("v8::Context::New()");
2883 LOG_API("Context::New"); 2882 LOG_API("Context::New");
2884 ON_BAILOUT("v8::Context::New()", return Persistent<Context>()); 2883 ON_BAILOUT("v8::Context::New()", return Persistent<Context>());
2885 2884
2886 // Enter V8 via an ENTER_V8 scope. 2885 // Enter V8 via an ENTER_V8 scope.
2887 i::Handle<i::Context> env; 2886 i::Handle<i::Context> env;
2888 { 2887 {
2889 ENTER_V8; 2888 ENTER_V8;
2890 #if defined(ANDROID)
2891 // On mobile device, full GC is expensive, leave it to the system to
2892 // decide when should make a full GC.
2893 #else
2894 // Give the heap a chance to cleanup if we've disposed contexts.
2895 i::Heap::CollectAllGarbageIfContextDisposedDeprecated();
2896 #endif
2897 v8::Handle<ObjectTemplate> proxy_template = global_template; 2889 v8::Handle<ObjectTemplate> proxy_template = global_template;
2898 i::Handle<i::FunctionTemplateInfo> proxy_constructor; 2890 i::Handle<i::FunctionTemplateInfo> proxy_constructor;
2899 i::Handle<i::FunctionTemplateInfo> global_constructor; 2891 i::Handle<i::FunctionTemplateInfo> global_constructor;
2900 2892
2901 if (!global_template.IsEmpty()) { 2893 if (!global_template.IsEmpty()) {
2902 // Make sure that the global_template has a constructor. 2894 // Make sure that the global_template has a constructor.
2903 global_constructor = 2895 global_constructor =
2904 EnsureConstructor(Utils::OpenHandle(*global_template)); 2896 EnsureConstructor(Utils::OpenHandle(*global_template));
2905 2897
2906 // Create a fresh template for the global proxy object. 2898 // Create a fresh template for the global proxy object.
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
3973 3965
3974 3966
3975 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3967 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3976 HandleScopeImplementer* thread_local = 3968 HandleScopeImplementer* thread_local =
3977 reinterpret_cast<HandleScopeImplementer*>(storage); 3969 reinterpret_cast<HandleScopeImplementer*>(storage);
3978 thread_local->IterateThis(v); 3970 thread_local->IterateThis(v);
3979 return storage + ArchiveSpacePerThread(); 3971 return storage + ArchiveSpacePerThread();
3980 } 3972 }
3981 3973
3982 } } // namespace v8::internal 3974 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698