| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 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 "log.h" | 34 #include "log.h" |
| 35 #include "isolate.h" | 35 #include "isolate.h" |
| 36 #include "serialize.h" | 36 #include "serialize.h" |
| 37 #include "scopeinfo.h" |
| 37 #include "simulator.h" | 38 #include "simulator.h" |
| 38 #include "stub-cache.h" | 39 #include "stub-cache.h" |
| 39 #include "oprofile-agent.h" | 40 #include "oprofile-agent.h" |
| 40 | 41 |
| 41 namespace v8 { | 42 namespace v8 { |
| 42 namespace internal { | 43 namespace internal { |
| 43 | 44 |
| 44 | 45 |
| 45 Isolate* Isolate::global_isolate = NULL; | 46 Isolate* Isolate::global_isolate = NULL; |
| 46 int Isolate::number_of_isolates_ = 0; | 47 int Isolate::number_of_isolates_ = 0; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 86 } |
| 86 } | 87 } |
| 87 | 88 |
| 88 | 89 |
| 89 Isolate::Isolate() | 90 Isolate::Isolate() |
| 90 : state_(UNINITIALIZED), | 91 : state_(UNINITIALIZED), |
| 91 bootstrapper_(NULL), | 92 bootstrapper_(NULL), |
| 92 break_access_(OS::CreateMutex()), | 93 break_access_(OS::CreateMutex()), |
| 93 stub_cache_(NULL), | 94 stub_cache_(NULL), |
| 94 transcendental_cache_(new TranscendentalCache()), | 95 transcendental_cache_(new TranscendentalCache()), |
| 96 keyed_lookup_cache_(new KeyedLookupCache()), |
| 97 context_slot_cache_(new ContextSlotCache()), |
| 98 descriptor_lookup_cache_(new DescriptorLookupCache()), |
| 95 handle_scope_implementer_(NULL) { | 99 handle_scope_implementer_(NULL) { |
| 96 heap_.isolate_ = this; | 100 heap_.isolate_ = this; |
| 97 stack_guard_.isolate_ = this; | 101 stack_guard_.isolate_ = this; |
| 98 | 102 |
| 99 handle_scope_data_.Initialize(); | 103 handle_scope_data_.Initialize(); |
| 100 | 104 |
| 101 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ | 105 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ |
| 102 name##_ = (initial_value); | 106 name##_ = (initial_value); |
| 103 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) | 107 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) |
| 104 #undef ISOLATE_INIT_EXECUTE | 108 #undef ISOLATE_INIT_EXECUTE |
| 105 | 109 |
| 106 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ | 110 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ |
| 107 memset(name##_, 0, sizeof(type) * length); | 111 memset(name##_, 0, sizeof(type) * length); |
| 108 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) | 112 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) |
| 109 #undef ISOLATE_INIT_ARRAY_EXECUTE | 113 #undef ISOLATE_INIT_ARRAY_EXECUTE |
| 110 } | 114 } |
| 111 | 115 |
| 112 | 116 |
| 113 Isolate::~Isolate() { | 117 Isolate::~Isolate() { |
| 118 delete descriptor_lookup_cache_; |
| 119 descriptor_lookup_cache_ = NULL; |
| 120 delete context_slot_cache_; |
| 121 context_slot_cache_ = NULL; |
| 122 delete keyed_lookup_cache_; |
| 123 keyed_lookup_cache_ = NULL; |
| 124 |
| 114 delete transcendental_cache_; | 125 delete transcendental_cache_; |
| 115 transcendental_cache_ = NULL; | 126 transcendental_cache_ = NULL; |
| 116 delete stub_cache_; | 127 delete stub_cache_; |
| 117 stub_cache_ = NULL; | 128 stub_cache_ = NULL; |
| 118 delete bootstrapper_; | 129 delete bootstrapper_; |
| 119 bootstrapper_ = NULL; | 130 bootstrapper_ = NULL; |
| 120 | 131 |
| 121 if (state_ == INITIALIZED) --number_of_isolates_; | 132 if (state_ == INITIALIZED) --number_of_isolates_; |
| 122 } | 133 } |
| 123 | 134 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 LOG(LogCodeObjects()); | 230 LOG(LogCodeObjects()); |
| 220 LOG(LogCompiledFunctions()); | 231 LOG(LogCompiledFunctions()); |
| 221 } | 232 } |
| 222 | 233 |
| 223 state_ = INITIALIZED; | 234 state_ = INITIALIZED; |
| 224 return true; | 235 return true; |
| 225 } | 236 } |
| 226 | 237 |
| 227 | 238 |
| 228 } } // namespace v8::internal | 239 } } // namespace v8::internal |
| OLD | NEW |