| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 } | 1272 } |
| 1273 #endif // ENABLE_DEBUGGER_SUPPORT | 1273 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1274 if (it.done()) return Handle<Context>::null(); | 1274 if (it.done()) return Handle<Context>::null(); |
| 1275 JavaScriptFrame* frame = it.frame(); | 1275 JavaScriptFrame* frame = it.frame(); |
| 1276 Context* context = Context::cast(frame->context()); | 1276 Context* context = Context::cast(frame->context()); |
| 1277 return Handle<Context>(context->global_context()); | 1277 return Handle<Context>(context->global_context()); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 | 1280 |
| 1281 char* Isolate::ArchiveThread(char* to) { | 1281 char* Isolate::ArchiveThread(char* to) { |
| 1282 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 1282 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { | 1283 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { |
| 1283 RuntimeProfiler::IsolateExitedJS(this); | 1284 RuntimeProfiler::IsolateExitedJS(this); |
| 1284 } | 1285 } |
| 1286 #endif |
| 1285 memcpy(to, reinterpret_cast<char*>(thread_local_top()), | 1287 memcpy(to, reinterpret_cast<char*>(thread_local_top()), |
| 1286 sizeof(ThreadLocalTop)); | 1288 sizeof(ThreadLocalTop)); |
| 1287 InitializeThreadLocal(); | 1289 InitializeThreadLocal(); |
| 1288 return to + sizeof(ThreadLocalTop); | 1290 return to + sizeof(ThreadLocalTop); |
| 1289 } | 1291 } |
| 1290 | 1292 |
| 1291 | 1293 |
| 1292 char* Isolate::RestoreThread(char* from) { | 1294 char* Isolate::RestoreThread(char* from) { |
| 1293 memcpy(reinterpret_cast<char*>(thread_local_top()), from, | 1295 memcpy(reinterpret_cast<char*>(thread_local_top()), from, |
| 1294 sizeof(ThreadLocalTop)); | 1296 sizeof(ThreadLocalTop)); |
| 1295 // This might be just paranoia, but it seems to be needed in case a | 1297 // This might be just paranoia, but it seems to be needed in case a |
| 1296 // thread_local_top_ is restored on a separate OS thread. | 1298 // thread_local_top_ is restored on a separate OS thread. |
| 1297 #ifdef USE_SIMULATOR | 1299 #ifdef USE_SIMULATOR |
| 1298 #ifdef V8_TARGET_ARCH_ARM | 1300 #ifdef V8_TARGET_ARCH_ARM |
| 1299 thread_local_top()->simulator_ = Simulator::current(this); | 1301 thread_local_top()->simulator_ = Simulator::current(this); |
| 1300 #elif V8_TARGET_ARCH_MIPS | 1302 #elif V8_TARGET_ARCH_MIPS |
| 1301 thread_local_top()->simulator_ = Simulator::current(this); | 1303 thread_local_top()->simulator_ = Simulator::current(this); |
| 1302 #endif | 1304 #endif |
| 1303 #endif | 1305 #endif |
| 1306 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 1304 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { | 1307 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { |
| 1305 RuntimeProfiler::IsolateEnteredJS(this); | 1308 RuntimeProfiler::IsolateEnteredJS(this); |
| 1306 } | 1309 } |
| 1310 #endif |
| 1307 return from + sizeof(ThreadLocalTop); | 1311 return from + sizeof(ThreadLocalTop); |
| 1308 } | 1312 } |
| 1309 | 1313 |
| 1310 | 1314 |
| 1311 Isolate::ThreadDataTable::ThreadDataTable() | 1315 Isolate::ThreadDataTable::ThreadDataTable() |
| 1312 : list_(NULL) { | 1316 : list_(NULL) { |
| 1313 } | 1317 } |
| 1314 | 1318 |
| 1315 | 1319 |
| 1316 Isolate::PerIsolateThreadData* | 1320 Isolate::PerIsolateThreadData* |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 | 1864 |
| 1861 #ifdef DEBUG | 1865 #ifdef DEBUG |
| 1862 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1866 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 1863 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1867 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 1864 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1868 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 1865 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1869 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 1866 #undef ISOLATE_FIELD_OFFSET | 1870 #undef ISOLATE_FIELD_OFFSET |
| 1867 #endif | 1871 #endif |
| 1868 | 1872 |
| 1869 } } // namespace v8::internal | 1873 } } // namespace v8::internal |
| OLD | NEW |