| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 | 64 |
| 65 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { | 65 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { |
| 66 return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); | 66 return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 void ThreadLocalTop::Initialize() { | 70 void ThreadLocalTop::Initialize() { |
| 71 c_entry_fp_ = 0; | 71 c_entry_fp_ = 0; |
| 72 handler_ = 0; | 72 handler_ = 0; |
| 73 #ifdef USE_SIMULATOR | 73 #if defined(USE_SIMULATOR) && \ |
| 74 #ifdef V8_TARGET_ARCH_ARM | 74 (defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)) |
| 75 simulator_ = Simulator::current(); | 75 simulator_ = Simulator::current(); |
| 76 #elif V8_TARGET_ARCH_MIPS | |
| 77 simulator_ = assembler::mips::Simulator::current(); | |
| 78 #endif | |
| 79 #endif | 76 #endif |
| 80 #ifdef ENABLE_LOGGING_AND_PROFILING | 77 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 81 js_entry_sp_ = NULL; | 78 js_entry_sp_ = NULL; |
| 82 external_callback_ = NULL; | 79 external_callback_ = NULL; |
| 83 #endif | 80 #endif |
| 84 #ifdef ENABLE_VMSTATE_TRACKING | 81 #ifdef ENABLE_VMSTATE_TRACKING |
| 85 current_vm_state_ = EXTERNAL; | 82 current_vm_state_ = EXTERNAL; |
| 86 runtime_profiler_state_ = Top::PROF_NOT_IN_JS; | 83 runtime_profiler_state_ = Top::PROF_NOT_IN_JS; |
| 87 #endif | 84 #endif |
| 88 try_catch_handler_address_ = NULL; | 85 try_catch_handler_address_ = NULL; |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_)); | 1129 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_)); |
| 1133 InitializeThreadLocal(); | 1130 InitializeThreadLocal(); |
| 1134 return to + sizeof(thread_local_); | 1131 return to + sizeof(thread_local_); |
| 1135 } | 1132 } |
| 1136 | 1133 |
| 1137 | 1134 |
| 1138 char* Top::RestoreThread(char* from) { | 1135 char* Top::RestoreThread(char* from) { |
| 1139 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); | 1136 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); |
| 1140 // This might be just paranoia, but it seems to be needed in case a | 1137 // This might be just paranoia, but it seems to be needed in case a |
| 1141 // thread_local_ is restored on a separate OS thread. | 1138 // thread_local_ is restored on a separate OS thread. |
| 1142 #ifdef USE_SIMULATOR | 1139 #if defined(USE_SIMULATOR) && \ |
| 1143 #ifdef V8_TARGET_ARCH_ARM | 1140 (defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)) |
| 1144 thread_local_.simulator_ = Simulator::current(); | 1141 thread_local_.simulator_ = Simulator::current(); |
| 1145 #elif V8_TARGET_ARCH_MIPS | |
| 1146 thread_local_.simulator_ = assembler::mips::Simulator::current(); | |
| 1147 #endif | |
| 1148 #endif | 1142 #endif |
| 1149 return from + sizeof(thread_local_); | 1143 return from + sizeof(thread_local_); |
| 1150 } | 1144 } |
| 1151 | 1145 |
| 1152 } } // namespace v8::internal | 1146 } } // namespace v8::internal |
| OLD | NEW |