| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (global_isolate->Init(des)) { | 57 if (global_isolate->Init(des)) { |
| 58 return global_isolate; | 58 return global_isolate; |
| 59 } else { | 59 } else { |
| 60 delete global_isolate; | 60 delete global_isolate; |
| 61 global_isolate = NULL; | 61 global_isolate = NULL; |
| 62 return NULL; | 62 return NULL; |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 Isolate::Isolate() { | 67 Isolate::Isolate() |
| 68 : stub_cache_(NULL) { |
| 68 } | 69 } |
| 69 | 70 |
| 70 | 71 |
| 71 Isolate::~Isolate() { | 72 Isolate::~Isolate() { |
| 73 delete stub_cache_; |
| 74 stub_cache_ = NULL; |
| 72 } | 75 } |
| 73 | 76 |
| 74 | 77 |
| 75 bool Isolate::Init(Deserializer* des) { | 78 bool Isolate::Init(Deserializer* des) { |
| 76 ASSERT(global_isolate == this); | 79 ASSERT(global_isolate == this); |
| 77 | 80 |
| 78 bool create_heap_objects = des == NULL; | 81 bool create_heap_objects = des == NULL; |
| 79 | 82 |
| 80 #ifdef DEBUG | 83 #ifdef DEBUG |
| 81 // The initialization process does not handle memory exhaustion. | 84 // The initialization process does not handle memory exhaustion. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 Top::Initialize(); | 118 Top::Initialize(); |
| 116 | 119 |
| 117 if (FLAG_preemption) { | 120 if (FLAG_preemption) { |
| 118 v8::Locker locker; | 121 v8::Locker locker; |
| 119 v8::Locker::StartPreemption(100); | 122 v8::Locker::StartPreemption(100); |
| 120 } | 123 } |
| 121 | 124 |
| 122 #ifdef ENABLE_DEBUGGER_SUPPORT | 125 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 123 Debug::Setup(create_heap_objects); | 126 Debug::Setup(create_heap_objects); |
| 124 #endif | 127 #endif |
| 128 stub_cache_ = new StubCache(); |
| 125 StubCache::Initialize(create_heap_objects); | 129 StubCache::Initialize(create_heap_objects); |
| 126 | 130 |
| 127 // If we are deserializing, read the state into the now-empty heap. | 131 // If we are deserializing, read the state into the now-empty heap. |
| 128 if (des != NULL) { | 132 if (des != NULL) { |
| 129 des->Deserialize(); | 133 des->Deserialize(); |
| 130 StubCache::Clear(); | 134 StubCache::Clear(); |
| 131 } | 135 } |
| 132 | 136 |
| 133 // Deserializing may put strange things in the root array's copy of the | 137 // Deserializing may put strange things in the root array's copy of the |
| 134 // stack guard. | 138 // stack guard. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 147 HandleScope scope; | 151 HandleScope scope; |
| 148 LOG(LogCodeObjects()); | 152 LOG(LogCodeObjects()); |
| 149 LOG(LogCompiledFunctions()); | 153 LOG(LogCompiledFunctions()); |
| 150 } | 154 } |
| 151 | 155 |
| 152 return true; | 156 return true; |
| 153 } | 157 } |
| 154 | 158 |
| 155 | 159 |
| 156 } } // namespace v8::internal | 160 } } // namespace v8::internal |
| OLD | NEW |