OLD | NEW |
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 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 v8::Handle<ObjectTemplate> global_template, | 2902 v8::Handle<ObjectTemplate> global_template, |
2903 v8::Handle<Value> global_object) { | 2903 v8::Handle<Value> global_object) { |
2904 EnsureInitialized("v8::Context::New()"); | 2904 EnsureInitialized("v8::Context::New()"); |
2905 LOG_API("Context::New"); | 2905 LOG_API("Context::New"); |
2906 ON_BAILOUT("v8::Context::New()", return Persistent<Context>()); | 2906 ON_BAILOUT("v8::Context::New()", return Persistent<Context>()); |
2907 | 2907 |
2908 // Enter V8 via an ENTER_V8 scope. | 2908 // Enter V8 via an ENTER_V8 scope. |
2909 i::Handle<i::Context> env; | 2909 i::Handle<i::Context> env; |
2910 { | 2910 { |
2911 ENTER_V8; | 2911 ENTER_V8; |
| 2912 |
| 2913 // BUG(632): Force GC to workaround instability issues. |
| 2914 i::Heap::CollectAllGarbage(false); |
| 2915 |
2912 v8::Handle<ObjectTemplate> proxy_template = global_template; | 2916 v8::Handle<ObjectTemplate> proxy_template = global_template; |
2913 i::Handle<i::FunctionTemplateInfo> proxy_constructor; | 2917 i::Handle<i::FunctionTemplateInfo> proxy_constructor; |
2914 i::Handle<i::FunctionTemplateInfo> global_constructor; | 2918 i::Handle<i::FunctionTemplateInfo> global_constructor; |
2915 | 2919 |
2916 if (!global_template.IsEmpty()) { | 2920 if (!global_template.IsEmpty()) { |
2917 // Make sure that the global_template has a constructor. | 2921 // Make sure that the global_template has a constructor. |
2918 global_constructor = | 2922 global_constructor = |
2919 EnsureConstructor(Utils::OpenHandle(*global_template)); | 2923 EnsureConstructor(Utils::OpenHandle(*global_template)); |
2920 | 2924 |
2921 // Create a fresh template for the global proxy object. | 2925 // Create a fresh template for the global proxy object. |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 | 3992 |
3989 | 3993 |
3990 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 3994 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
3991 HandleScopeImplementer* thread_local = | 3995 HandleScopeImplementer* thread_local = |
3992 reinterpret_cast<HandleScopeImplementer*>(storage); | 3996 reinterpret_cast<HandleScopeImplementer*>(storage); |
3993 thread_local->IterateThis(v); | 3997 thread_local->IterateThis(v); |
3994 return storage + ArchiveSpacePerThread(); | 3998 return storage + ArchiveSpacePerThread(); |
3995 } | 3999 } |
3996 | 4000 |
3997 } } // namespace v8::internal | 4001 } } // namespace v8::internal |
OLD | NEW |