Chromium Code Reviews| 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/free-buffer-extension.h" | |
|
Michael Achenbach
2013/11/26 15:08:57
Is an #ifdef ADDRESS_SANITIZER necessary here?
Dmitry Lomov (no reviews)
2013/11/26 15:22:10
Not necessary, since the act of including the hea
| |
| 44 #include "extensions/externalize-string-extension.h" | 45 #include "extensions/externalize-string-extension.h" |
| 45 #include "extensions/gc-extension.h" | 46 #include "extensions/gc-extension.h" |
| 46 #include "extensions/statistics-extension.h" | 47 #include "extensions/statistics-extension.h" |
| 47 #include "code-stubs.h" | 48 #include "code-stubs.h" |
| 48 | 49 |
| 49 namespace v8 { | 50 namespace v8 { |
| 50 namespace internal { | 51 namespace internal { |
| 51 | 52 |
| 52 | 53 |
| 53 NativesExternalStringResource::NativesExternalStringResource( | 54 NativesExternalStringResource::NativesExternalStringResource( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 return Handle<String>::cast(cached_source); | 94 return Handle<String>::cast(cached_source); |
| 94 } | 95 } |
| 95 | 96 |
| 96 | 97 |
| 97 void Bootstrapper::Initialize(bool create_heap_objects) { | 98 void Bootstrapper::Initialize(bool create_heap_objects) { |
| 98 extensions_cache_.Initialize(isolate_, create_heap_objects); | 99 extensions_cache_.Initialize(isolate_, create_heap_objects); |
| 99 } | 100 } |
| 100 | 101 |
| 101 | 102 |
| 102 void Bootstrapper::InitializeOncePerProcess() { | 103 void Bootstrapper::InitializeOncePerProcess() { |
| 104 #ifdef ADDRESS_SANITIZER | |
| 105 FreeBufferExtension::Register(); | |
| 106 #endif | |
| 103 GCExtension::Register(); | 107 GCExtension::Register(); |
| 104 ExternalizeStringExtension::Register(); | 108 ExternalizeStringExtension::Register(); |
| 105 StatisticsExtension::Register(); | 109 StatisticsExtension::Register(); |
| 106 } | 110 } |
| 107 | 111 |
| 108 | 112 |
| 109 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { | 113 char* Bootstrapper::AllocateAutoDeletedArray(int bytes) { |
| 110 char* memory = new char[bytes]; | 114 char* memory = new char[bytes]; |
| 111 if (memory != NULL) { | 115 if (memory != NULL) { |
| 112 if (delete_these_arrays_on_tear_down_ == NULL) { | 116 if (delete_these_arrays_on_tear_down_ == NULL) { |
| (...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2271 Isolate* isolate = native_context->GetIsolate(); | 2275 Isolate* isolate = native_context->GetIsolate(); |
| 2272 ExtensionStates extension_states; // All extensions have state UNVISITED. | 2276 ExtensionStates extension_states; // All extensions have state UNVISITED. |
| 2273 // Install auto extensions. | 2277 // Install auto extensions. |
| 2274 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension(); | 2278 v8::RegisteredExtension* current = v8::RegisteredExtension::first_extension(); |
| 2275 while (current != NULL) { | 2279 while (current != NULL) { |
| 2276 if (current->extension()->auto_enable()) | 2280 if (current->extension()->auto_enable()) |
| 2277 InstallExtension(isolate, current, &extension_states); | 2281 InstallExtension(isolate, current, &extension_states); |
| 2278 current = current->next(); | 2282 current = current->next(); |
| 2279 } | 2283 } |
| 2280 | 2284 |
| 2285 #ifdef ADDRESS_SANITIZER | |
| 2286 if (FLAG_expose_free_buffer) { | |
| 2287 InstallExtension(isolate, "v8/free-buffer", &extension_states); | |
| 2288 } | |
| 2289 #endif | |
| 2281 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); | 2290 if (FLAG_expose_gc) InstallExtension(isolate, "v8/gc", &extension_states); |
| 2282 if (FLAG_expose_externalize_string) { | 2291 if (FLAG_expose_externalize_string) { |
| 2283 InstallExtension(isolate, "v8/externalize", &extension_states); | 2292 InstallExtension(isolate, "v8/externalize", &extension_states); |
| 2284 } | 2293 } |
| 2285 if (FLAG_track_gc_object_stats) { | 2294 if (FLAG_track_gc_object_stats) { |
| 2286 InstallExtension(isolate, "v8/statistics", &extension_states); | 2295 InstallExtension(isolate, "v8/statistics", &extension_states); |
| 2287 } | 2296 } |
| 2288 | 2297 |
| 2289 if (extensions == NULL) return true; | 2298 if (extensions == NULL) return true; |
| 2290 // Install required extensions | 2299 // Install required extensions |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2717 return from + sizeof(NestingCounterType); | 2726 return from + sizeof(NestingCounterType); |
| 2718 } | 2727 } |
| 2719 | 2728 |
| 2720 | 2729 |
| 2721 // Called when the top-level V8 mutex is destroyed. | 2730 // Called when the top-level V8 mutex is destroyed. |
| 2722 void Bootstrapper::FreeThreadResources() { | 2731 void Bootstrapper::FreeThreadResources() { |
| 2723 ASSERT(!IsActive()); | 2732 ASSERT(!IsActive()); |
| 2724 } | 2733 } |
| 2725 | 2734 |
| 2726 } } // namespace v8::internal | 2735 } } // namespace v8::internal |
| OLD | NEW |