| OLD | NEW |
| 1 // Copyright 2006-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2010 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 17 matching lines...) Expand all Loading... |
| 28 #include <stdlib.h> | 28 #include <stdlib.h> |
| 29 | 29 |
| 30 #include "v8.h" | 30 #include "v8.h" |
| 31 | 31 |
| 32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
| 33 #include "debug.h" | 33 #include "debug.h" |
| 34 #include "heap-profiler.h" | 34 #include "heap-profiler.h" |
| 35 #include "isolate.h" | 35 #include "isolate.h" |
| 36 #include "log.h" | 36 #include "log.h" |
| 37 #include "serialize.h" | 37 #include "serialize.h" |
| 38 #include "scanner.h" |
| 38 #include "scopeinfo.h" | 39 #include "scopeinfo.h" |
| 39 #include "simulator.h" | 40 #include "simulator.h" |
| 40 #include "stub-cache.h" | 41 #include "stub-cache.h" |
| 41 #include "oprofile-agent.h" | 42 #include "oprofile-agent.h" |
| 42 | 43 |
| 43 namespace v8 { | 44 namespace v8 { |
| 44 namespace internal { | 45 namespace internal { |
| 45 | 46 |
| 46 | 47 |
| 47 #ifdef V8_USE_TLS_FOR_GLOBAL_ISOLATE | 48 #ifdef V8_USE_TLS_FOR_GLOBAL_ISOLATE |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 Isolate::Isolate() | 109 Isolate::Isolate() |
| 109 : state_(UNINITIALIZED), | 110 : state_(UNINITIALIZED), |
| 110 bootstrapper_(NULL), | 111 bootstrapper_(NULL), |
| 111 cpu_features_(NULL), | 112 cpu_features_(NULL), |
| 112 break_access_(OS::CreateMutex()), | 113 break_access_(OS::CreateMutex()), |
| 113 stub_cache_(NULL), | 114 stub_cache_(NULL), |
| 114 transcendental_cache_(new TranscendentalCache()), | 115 transcendental_cache_(new TranscendentalCache()), |
| 115 keyed_lookup_cache_(new KeyedLookupCache()), | 116 keyed_lookup_cache_(new KeyedLookupCache()), |
| 116 context_slot_cache_(new ContextSlotCache()), | 117 context_slot_cache_(new ContextSlotCache()), |
| 117 descriptor_lookup_cache_(new DescriptorLookupCache()), | 118 descriptor_lookup_cache_(new DescriptorLookupCache()), |
| 118 handle_scope_implementer_(NULL) { | 119 handle_scope_implementer_(NULL), |
| 120 scanner_character_classes_(new ScannerCharacterClasses()) { |
| 119 heap_.isolate_ = this; | 121 heap_.isolate_ = this; |
| 120 stack_guard_.isolate_ = this; | 122 stack_guard_.isolate_ = this; |
| 121 | 123 |
| 122 handle_scope_data_.Initialize(); | 124 handle_scope_data_.Initialize(); |
| 123 | 125 |
| 124 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ | 126 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ |
| 125 name##_ = (initial_value); | 127 name##_ = (initial_value); |
| 126 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) | 128 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) |
| 127 #undef ISOLATE_INIT_EXECUTE | 129 #undef ISOLATE_INIT_EXECUTE |
| 128 | 130 |
| 129 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ | 131 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ |
| 130 memset(name##_, 0, sizeof(type) * length); | 132 memset(name##_, 0, sizeof(type) * length); |
| 131 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) | 133 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) |
| 132 #undef ISOLATE_INIT_ARRAY_EXECUTE | 134 #undef ISOLATE_INIT_ARRAY_EXECUTE |
| 133 } | 135 } |
| 134 | 136 |
| 135 | 137 |
| 136 Isolate::~Isolate() { | 138 Isolate::~Isolate() { |
| 139 delete scanner_character_classes_; |
| 140 scanner_character_classes_ = NULL; |
| 141 |
| 137 delete descriptor_lookup_cache_; | 142 delete descriptor_lookup_cache_; |
| 138 descriptor_lookup_cache_ = NULL; | 143 descriptor_lookup_cache_ = NULL; |
| 139 delete context_slot_cache_; | 144 delete context_slot_cache_; |
| 140 context_slot_cache_ = NULL; | 145 context_slot_cache_ = NULL; |
| 141 delete keyed_lookup_cache_; | 146 delete keyed_lookup_cache_; |
| 142 keyed_lookup_cache_ = NULL; | 147 keyed_lookup_cache_ = NULL; |
| 143 | 148 |
| 144 delete transcendental_cache_; | 149 delete transcendental_cache_; |
| 145 transcendental_cache_ = NULL; | 150 transcendental_cache_ = NULL; |
| 146 delete stub_cache_; | 151 delete stub_cache_; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 LOG(LogCodeObjects()); | 262 LOG(LogCodeObjects()); |
| 258 LOG(LogCompiledFunctions()); | 263 LOG(LogCompiledFunctions()); |
| 259 } | 264 } |
| 260 | 265 |
| 261 state_ = INITIALIZED; | 266 state_ = INITIALIZED; |
| 262 return true; | 267 return true; |
| 263 } | 268 } |
| 264 | 269 |
| 265 | 270 |
| 266 } } // namespace v8::internal | 271 } } // namespace v8::internal |
| OLD | NEW |