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

Side by Side Diff: src/api.cc

Issue 660268: Merge r3971 and r3984 to trunk forming V8 version 2.1.2.4. This adds... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
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 | « include/v8.h ('k') | 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::NotifyContextDisposed(); 441 if ((*obj)->IsGlobalContext()) i::Heap::NotifyContextDisposedDeprecated();
442 i::GlobalHandles::Destroy(obj); 442 i::GlobalHandles::Destroy(obj);
443 } 443 }
444 444
445 // --- H a n d l e s --- 445 // --- H a n d l e s ---
446 446
447 447
448 HandleScope::HandleScope() : is_closed_(false) { 448 HandleScope::HandleScope() : is_closed_(false) {
449 API_ENTRY_CHECK("HandleScope::HandleScope"); 449 API_ENTRY_CHECK("HandleScope::HandleScope");
450 i::HandleScope::Enter(&previous_); 450 i::HandleScope::Enter(&previous_);
451 } 451 }
(...skipping 2362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 return i::V8::IdleNotification(); 2814 return i::V8::IdleNotification();
2815 } 2815 }
2816 2816
2817 2817
2818 void v8::V8::LowMemoryNotification() { 2818 void v8::V8::LowMemoryNotification() {
2819 if (!i::V8::IsRunning()) return; 2819 if (!i::V8::IsRunning()) return;
2820 i::Heap::CollectAllGarbage(true); 2820 i::Heap::CollectAllGarbage(true);
2821 } 2821 }
2822 2822
2823 2823
2824 void v8::V8::ContextDisposedNotification() {
2825 if (!i::V8::IsRunning()) return;
2826 i::Heap::NotifyContextDisposed();
2827 }
2828
2829
2824 const char* v8::V8::GetVersion() { 2830 const char* v8::V8::GetVersion() {
2825 static v8::internal::EmbeddedVector<char, 128> buffer; 2831 static v8::internal::EmbeddedVector<char, 128> buffer;
2826 v8::internal::Version::GetString(buffer); 2832 v8::internal::Version::GetString(buffer);
2827 return buffer.start(); 2833 return buffer.start();
2828 } 2834 }
2829 2835
2830 2836
2831 static i::Handle<i::FunctionTemplateInfo> 2837 static i::Handle<i::FunctionTemplateInfo>
2832 EnsureConstructor(i::Handle<i::ObjectTemplateInfo> templ) { 2838 EnsureConstructor(i::Handle<i::ObjectTemplateInfo> templ) {
2833 if (templ->constructor()->IsUndefined()) { 2839 if (templ->constructor()->IsUndefined()) {
(...skipping 16 matching lines...) Expand all
2850 2856
2851 // Enter V8 via an ENTER_V8 scope. 2857 // Enter V8 via an ENTER_V8 scope.
2852 i::Handle<i::Context> env; 2858 i::Handle<i::Context> env;
2853 { 2859 {
2854 ENTER_V8; 2860 ENTER_V8;
2855 #if defined(ANDROID) 2861 #if defined(ANDROID)
2856 // On mobile device, full GC is expensive, leave it to the system to 2862 // On mobile device, full GC is expensive, leave it to the system to
2857 // decide when should make a full GC. 2863 // decide when should make a full GC.
2858 #else 2864 #else
2859 // Give the heap a chance to cleanup if we've disposed contexts. 2865 // Give the heap a chance to cleanup if we've disposed contexts.
2860 i::Heap::CollectAllGarbageIfContextDisposed(); 2866 i::Heap::CollectAllGarbageIfContextDisposedDeprecated();
2861 #endif 2867 #endif
2862 v8::Handle<ObjectTemplate> proxy_template = global_template; 2868 v8::Handle<ObjectTemplate> proxy_template = global_template;
2863 i::Handle<i::FunctionTemplateInfo> proxy_constructor; 2869 i::Handle<i::FunctionTemplateInfo> proxy_constructor;
2864 i::Handle<i::FunctionTemplateInfo> global_constructor; 2870 i::Handle<i::FunctionTemplateInfo> global_constructor;
2865 2871
2866 if (!global_template.IsEmpty()) { 2872 if (!global_template.IsEmpty()) {
2867 // Make sure that the global_template has a constructor. 2873 // Make sure that the global_template has a constructor.
2868 global_constructor = 2874 global_constructor =
2869 EnsureConstructor(Utils::OpenHandle(*global_template)); 2875 EnsureConstructor(Utils::OpenHandle(*global_template));
2870 2876
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
3938 3944
3939 3945
3940 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3946 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3941 HandleScopeImplementer* thread_local = 3947 HandleScopeImplementer* thread_local =
3942 reinterpret_cast<HandleScopeImplementer*>(storage); 3948 reinterpret_cast<HandleScopeImplementer*>(storage);
3943 thread_local->IterateThis(v); 3949 thread_local->IterateThis(v);
3944 return storage + ArchiveSpacePerThread(); 3950 return storage + ArchiveSpacePerThread();
3945 } 3951 }
3946 3952
3947 } } // namespace v8::internal 3953 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698