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 23 matching lines...) Expand all Loading... |
34 #include "debug.h" | 34 #include "debug.h" |
35 #include "execution.h" | 35 #include "execution.h" |
36 #include "global-handles.h" | 36 #include "global-handles.h" |
37 #include "isolate-inl.h" | 37 #include "isolate-inl.h" |
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 "trig-table.h" | 43 #include "trig-table.h" |
| 44 #include "extensions/externalize-string-extension.h" |
44 #include "extensions/free-buffer-extension.h" | 45 #include "extensions/free-buffer-extension.h" |
45 #include "extensions/externalize-string-extension.h" | |
46 #include "extensions/gc-extension.h" | 46 #include "extensions/gc-extension.h" |
47 #include "extensions/statistics-extension.h" | 47 #include "extensions/statistics-extension.h" |
| 48 #include "extensions/trigger-failure-extension.h" |
48 #include "code-stubs.h" | 49 #include "code-stubs.h" |
49 | 50 |
50 namespace v8 { | 51 namespace v8 { |
51 namespace internal { | 52 namespace internal { |
52 | 53 |
53 | 54 |
54 NativesExternalStringResource::NativesExternalStringResource( | 55 NativesExternalStringResource::NativesExternalStringResource( |
55 Bootstrapper* bootstrapper, | 56 Bootstrapper* bootstrapper, |
56 const char* source, | 57 const char* source, |
57 size_t length) | 58 size_t length) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 101 } |
101 | 102 |
102 | 103 |
103 void Bootstrapper::InitializeOncePerProcess() { | 104 void Bootstrapper::InitializeOncePerProcess() { |
104 #ifdef ADDRESS_SANITIZER | 105 #ifdef ADDRESS_SANITIZER |
105 FreeBufferExtension::Register(); | 106 FreeBufferExtension::Register(); |
106 #endif | 107 #endif |
107 GCExtension::Register(); | 108 GCExtension::Register(); |
108 ExternalizeStringExtension::Register(); | 109 ExternalizeStringExtension::Register(); |
109 StatisticsExtension::Register(); | 110 StatisticsExtension::Register(); |
| 111 TriggerFailureExtension::Register(); |
110 } | 112 } |
111 | 113 |
112 | 114 |
113 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { | 115 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { |
114 char* memory = new char[bytes]; | 116 char* memory = new char[bytes]; |
115 if (memory != NULL) { | 117 if (memory != NULL) { |
116 if (delete_these_arrays_on_tear_down_ == NULL) { | 118 if (delete_these_arrays_on_tear_down_ == NULL) { |
117 delete_these_arrays_on_tear_down_ = new List<char*>(2); | 119 delete_these_arrays_on_tear_down_ = new List<char*>(2); |
118 } | 120 } |
119 delete_these_arrays_on_tear_down_->Add(memory); | 121 delete_these_arrays_on_tear_down_->Add(memory); |
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2259 InstallExtension(isolate, "v8/free-buffer", &extension_states); | 2261 InstallExtension(isolate, "v8/free-buffer", &extension_states); |
2260 } | 2262 } |
2261 #endif | 2263 #endif |
2262 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); | 2264 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); |
2263 if (FLAG_expose_externalize_string) { | 2265 if (FLAG_expose_externalize_string) { |
2264 InstallExtension(isolate, "v8/externalize", &extension_states); | 2266 InstallExtension(isolate, "v8/externalize", &extension_states); |
2265 } | 2267 } |
2266 if (FLAG_track_gc_object_stats) { | 2268 if (FLAG_track_gc_object_stats) { |
2267 InstallExtension(isolate, "v8/statistics", &extension_states); | 2269 InstallExtension(isolate, "v8/statistics", &extension_states); |
2268 } | 2270 } |
| 2271 if (FLAG_expose_trigger_failure) { |
| 2272 InstallExtension(isolate, "v8/trigger-failure", &extension_states); |
| 2273 } |
2269 | 2274 |
2270 if (extensions == NULL) return true; | 2275 if (extensions == NULL) return true; |
2271 // Install required extensions | 2276 // Install required extensions |
2272 int count = v8::ImplementationUtilities::GetNameCount(extensions); | 2277 int count = v8::ImplementationUtilities::GetNameCount(extensions); |
2273 const char** names = v8::ImplementationUtilities::GetNames(extensions); | 2278 const char** names = v8::ImplementationUtilities::GetNames(extensions); |
2274 for (int i = 0; i < count; i++) { | 2279 for (int i = 0; i < count; i++) { |
2275 if (!InstallExtension(isolate, names[i], &extension_states)) | 2280 if (!InstallExtension(isolate, names[i], &extension_states)) |
2276 return false; | 2281 return false; |
2277 } | 2282 } |
2278 | 2283 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 return from + sizeof(NestingCounterType); | 2706 return from + sizeof(NestingCounterType); |
2702 } | 2707 } |
2703 | 2708 |
2704 | 2709 |
2705 // Called when the top-level V8 mutex is destroyed. | 2710 // Called when the top-level V8 mutex is destroyed. |
2706 void Bootstrapper::FreeThreadResources() { | 2711 void Bootstrapper::FreeThreadResources() { |
2707 ASSERT(!IsActive()); | 2712 ASSERT(!IsActive()); |
2708 } | 2713 } |
2709 | 2714 |
2710 } } // namespace v8::internal | 2715 } } // namespace v8::internal |
OLD | NEW |