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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { | 61 v8::TryCatch* ThreadLocalTop::TryCatchHandler() { |
62 return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); | 62 return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); |
63 } | 63 } |
64 | 64 |
65 | 65 |
66 void ThreadLocalTop::Initialize() { | 66 void ThreadLocalTop::Initialize() { |
67 c_entry_fp_ = 0; | 67 c_entry_fp_ = 0; |
68 handler_ = 0; | 68 handler_ = 0; |
69 #ifdef USE_SIMULATOR | 69 #ifdef USE_SIMULATOR |
| 70 #ifdef V8_TARGET_ARCH_ARM |
70 simulator_ = assembler::arm::Simulator::current(); | 71 simulator_ = assembler::arm::Simulator::current(); |
71 #endif // USE_SIMULATOR | 72 #elif V8_TARGET_ARCH_MIPS |
| 73 simulator_ = assembler::mips::Simulator::current(); |
| 74 #endif |
| 75 #endif |
72 #ifdef ENABLE_LOGGING_AND_PROFILING | 76 #ifdef ENABLE_LOGGING_AND_PROFILING |
73 js_entry_sp_ = 0; | 77 js_entry_sp_ = 0; |
74 #endif | 78 #endif |
75 #ifdef ENABLE_VMSTATE_TRACKING | 79 #ifdef ENABLE_VMSTATE_TRACKING |
76 current_vm_state_ = NULL; | 80 current_vm_state_ = NULL; |
77 #endif | 81 #endif |
78 try_catch_handler_address_ = NULL; | 82 try_catch_handler_address_ = NULL; |
79 context_ = NULL; | 83 context_ = NULL; |
80 int id = ThreadManager::CurrentId(); | 84 int id = ThreadManager::CurrentId(); |
81 thread_id_ = (id == 0) ? ThreadManager::kInvalidId : id; | 85 thread_id_ = (id == 0) ? ThreadManager::kInvalidId : id; |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 InitializeThreadLocal(); | 1063 InitializeThreadLocal(); |
1060 return to + sizeof(thread_local_); | 1064 return to + sizeof(thread_local_); |
1061 } | 1065 } |
1062 | 1066 |
1063 | 1067 |
1064 char* Top::RestoreThread(char* from) { | 1068 char* Top::RestoreThread(char* from) { |
1065 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); | 1069 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); |
1066 // This might be just paranoia, but it seems to be needed in case a | 1070 // This might be just paranoia, but it seems to be needed in case a |
1067 // thread_local_ is restored on a separate OS thread. | 1071 // thread_local_ is restored on a separate OS thread. |
1068 #ifdef USE_SIMULATOR | 1072 #ifdef USE_SIMULATOR |
| 1073 #ifdef V8_TARGET_ARCH_ARM |
1069 thread_local_.simulator_ = assembler::arm::Simulator::current(); | 1074 thread_local_.simulator_ = assembler::arm::Simulator::current(); |
| 1075 #elif V8_TARGET_ARCH_MIPS |
| 1076 thread_local_.simulator_ = assembler::mips::Simulator::current(); |
| 1077 #endif |
1070 #endif | 1078 #endif |
1071 return from + sizeof(thread_local_); | 1079 return from + sizeof(thread_local_); |
1072 } | 1080 } |
1073 | 1081 |
1074 | 1082 |
1075 ExecutionAccess::ExecutionAccess() { | 1083 ExecutionAccess::ExecutionAccess() { |
1076 Top::break_access_->Lock(); | 1084 Top::break_access_->Lock(); |
1077 } | 1085 } |
1078 | 1086 |
1079 | 1087 |
1080 ExecutionAccess::~ExecutionAccess() { | 1088 ExecutionAccess::~ExecutionAccess() { |
1081 Top::break_access_->Unlock(); | 1089 Top::break_access_->Unlock(); |
1082 } | 1090 } |
1083 | 1091 |
1084 | 1092 |
1085 } } // namespace v8::internal | 1093 } } // namespace v8::internal |
OLD | NEW |