OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 27 matching lines...) Expand all Loading... |
38 #include "macro-assembler.h" | 38 #include "macro-assembler.h" |
39 #include "natives.h" | 39 #include "natives.h" |
40 #include "objects-visiting.h" | 40 #include "objects-visiting.h" |
41 #include "platform.h" | 41 #include "platform.h" |
42 #include "snapshot.h" | 42 #include "snapshot.h" |
43 #include "extensions/externalize-string-extension.h" | 43 #include "extensions/externalize-string-extension.h" |
44 #include "extensions/gc-extension.h" | 44 #include "extensions/gc-extension.h" |
45 #include "extensions/statistics-extension.h" | 45 #include "extensions/statistics-extension.h" |
46 #include "code-stubs.h" | 46 #include "code-stubs.h" |
47 | 47 |
48 #if defined(V8_I18N_SUPPORT) | |
49 #include "extensions/i18n/i18n-extension.h" | |
50 #endif | |
51 | |
52 namespace v8 { | 48 namespace v8 { |
53 namespace internal { | 49 namespace internal { |
54 | 50 |
55 | 51 |
56 NativesExternalStringResource::NativesExternalStringResource( | 52 NativesExternalStringResource::NativesExternalStringResource( |
57 Bootstrapper* bootstrapper, | 53 Bootstrapper* bootstrapper, |
58 const char* source, | 54 const char* source, |
59 size_t length) | 55 size_t length) |
60 : data_(source), length_(length) { | 56 : data_(source), length_(length) { |
61 if (bootstrapper->delete_these_non_arrays_on_tear_down_ == NULL) { | 57 if (bootstrapper->delete_these_non_arrays_on_tear_down_ == NULL) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 95 |
100 void Bootstrapper::Initialize(bool create_heap_objects) { | 96 void Bootstrapper::Initialize(bool create_heap_objects) { |
101 extensions_cache_.Initialize(create_heap_objects); | 97 extensions_cache_.Initialize(create_heap_objects); |
102 } | 98 } |
103 | 99 |
104 | 100 |
105 void Bootstrapper::InitializeOncePerProcess() { | 101 void Bootstrapper::InitializeOncePerProcess() { |
106 GCExtension::Register(); | 102 GCExtension::Register(); |
107 ExternalizeStringExtension::Register(); | 103 ExternalizeStringExtension::Register(); |
108 StatisticsExtension::Register(); | 104 StatisticsExtension::Register(); |
109 #if defined(V8_I18N_SUPPORT) | |
110 v8_i18n::Extension::Register(); | |
111 #endif | |
112 } | 105 } |
113 | 106 |
114 | 107 |
115 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { | 108 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { |
116 char* memory = new char[bytes]; | 109 char* memory = new char[bytes]; |
117 if (memory != NULL) { | 110 if (memory != NULL) { |
118 if (delete_these_arrays_on_tear_down_ == NULL) { | 111 if (delete_these_arrays_on_tear_down_ == NULL) { |
119 delete_these_arrays_on_tear_down_ = new List<char*>(2); | 112 delete_these_arrays_on_tear_down_ = new List<char*>(2); |
120 } | 113 } |
121 delete_these_arrays_on_tear_down_->Add(memory); | 114 delete_these_arrays_on_tear_down_->Add(memory); |
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2300 } | 2293 } |
2301 | 2294 |
2302 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); | 2295 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); |
2303 if (FLAG_expose_externalize_string) { | 2296 if (FLAG_expose_externalize_string) { |
2304 InstallExtension(isolate, "v8/externalize", &extension_states); | 2297 InstallExtension(isolate, "v8/externalize", &extension_states); |
2305 } | 2298 } |
2306 if (FLAG_track_gc_object_stats) { | 2299 if (FLAG_track_gc_object_stats) { |
2307 InstallExtension(isolate, "v8/statistics", &extension_states); | 2300 InstallExtension(isolate, "v8/statistics", &extension_states); |
2308 } | 2301 } |
2309 | 2302 |
2310 #if defined(V8_I18N_SUPPORT) | |
2311 if (FLAG_enable_i18n) { | |
2312 InstallExtension(isolate, "v8/i18n", &extension_states); | |
2313 } | |
2314 #endif | |
2315 | |
2316 if (extensions == NULL) return true; | 2303 if (extensions == NULL) return true; |
2317 // Install required extensions | 2304 // Install required extensions |
2318 int count = v8::ImplementationUtilities::GetNameCount(extensions); | 2305 int count = v8::ImplementationUtilities::GetNameCount(extensions); |
2319 const char** names = v8::ImplementationUtilities::GetNames(extensions); | 2306 const char** names = v8::ImplementationUtilities::GetNames(extensions); |
2320 for (int i = 0; i < count; i++) { | 2307 for (int i = 0; i < count; i++) { |
2321 if (!InstallExtension(isolate, names[i], &extension_states)) | 2308 if (!InstallExtension(isolate, names[i], &extension_states)) |
2322 return false; | 2309 return false; |
2323 } | 2310 } |
2324 | 2311 |
2325 return true; | 2312 return true; |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2685 return from + sizeof(NestingCounterType); | 2672 return from + sizeof(NestingCounterType); |
2686 } | 2673 } |
2687 | 2674 |
2688 | 2675 |
2689 // Called when the top-level V8 mutex is destroyed. | 2676 // Called when the top-level V8 mutex is destroyed. |
2690 void Bootstrapper::FreeThreadResources() { | 2677 void Bootstrapper::FreeThreadResources() { |
2691 ASSERT(!IsActive()); | 2678 ASSERT(!IsActive()); |
2692 } | 2679 } |
2693 | 2680 |
2694 } } // namespace v8::internal | 2681 } } // namespace v8::internal |
OLD | NEW |