OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 error = *result; | 3223 error = *result; |
3224 } | 3224 } |
3225 i::Handle<i::Object> result(error); | 3225 i::Handle<i::Object> result(error); |
3226 return Utils::ToLocal(result); | 3226 return Utils::ToLocal(result); |
3227 } | 3227 } |
3228 | 3228 |
3229 | 3229 |
3230 // --- D e b u g S u p p o r t --- | 3230 // --- D e b u g S u p p o r t --- |
3231 | 3231 |
3232 #ifdef ENABLE_DEBUGGER_SUPPORT | 3232 #ifdef ENABLE_DEBUGGER_SUPPORT |
3233 bool Debug::SetDebugEventListener(DebugEventCallback that, Handle<Value> data) { | 3233 bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) { |
3234 EnsureInitialized("v8::Debug::SetDebugEventListener()"); | 3234 EnsureInitialized("v8::Debug::SetDebugEventListener()"); |
3235 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); | 3235 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); |
3236 ENTER_V8; | 3236 ENTER_V8; |
3237 HandleScope scope; | 3237 HandleScope scope; |
3238 i::Handle<i::Object> proxy = i::Factory::undefined_value(); | 3238 i::Handle<i::Object> proxy = i::Factory::undefined_value(); |
3239 if (that != NULL) { | 3239 if (that != NULL) { |
3240 proxy = i::Factory::NewProxy(FUNCTION_ADDR(that)); | 3240 proxy = i::Factory::NewProxy(FUNCTION_ADDR(that)); |
3241 } | 3241 } |
3242 i::Debugger::SetEventListener(proxy, Utils::OpenHandle(*data)); | 3242 i::Debugger::SetEventListener(proxy, Utils::OpenHandle(*data)); |
3243 return true; | 3243 return true; |
3244 } | 3244 } |
3245 | 3245 |
3246 | 3246 |
3247 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that, | 3247 bool Debug::SetDebugEventListener(v8::Handle<v8::Object> that, |
3248 Handle<Value> data) { | 3248 Handle<Value> data) { |
3249 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); | 3249 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); |
3250 ENTER_V8; | 3250 ENTER_V8; |
3251 i::Debugger::SetEventListener(Utils::OpenHandle(*that), | 3251 i::Debugger::SetEventListener(Utils::OpenHandle(*that), |
3252 Utils::OpenHandle(*data)); | 3252 Utils::OpenHandle(*data)); |
3253 return true; | 3253 return true; |
3254 } | 3254 } |
3255 | 3255 |
3256 | 3256 |
3257 void Debug::DebugBreak() { | 3257 void Debug::DebugBreak() { |
3258 if (!i::V8::HasBeenSetup()) return; | 3258 if (!i::V8::HasBeenSetup()) return; |
3259 i::StackGuard::DebugBreak(); | 3259 i::StackGuard::DebugBreak(); |
3260 } | 3260 } |
3261 | 3261 |
3262 | 3262 |
3263 void Debug::SetMessageHandler(v8::DebugMessageHandler handler, void* data, | 3263 void Debug::SetMessageHandler(v8::Debug::MessageHandler handler, |
3264 bool message_handler_thread) { | 3264 bool message_handler_thread) { |
3265 EnsureInitialized("v8::Debug::SetMessageHandler"); | 3265 EnsureInitialized("v8::Debug::SetMessageHandler"); |
3266 ENTER_V8; | 3266 ENTER_V8; |
3267 i::Debugger::SetMessageHandler(handler, data, message_handler_thread); | 3267 i::Debugger::SetMessageHandler(handler, message_handler_thread); |
3268 } | 3268 } |
3269 | 3269 |
3270 | 3270 |
3271 void Debug::SendCommand(const uint16_t* command, int length) { | 3271 void Debug::SendCommand(const uint16_t* command, int length, |
| 3272 ClientData* client_data) { |
3272 if (!i::V8::HasBeenSetup()) return; | 3273 if (!i::V8::HasBeenSetup()) return; |
3273 i::Debugger::ProcessCommand(i::Vector<const uint16_t>(command, length)); | 3274 i::Debugger::ProcessCommand(i::Vector<const uint16_t>(command, length), |
| 3275 client_data); |
3274 } | 3276 } |
3275 | 3277 |
3276 | 3278 |
3277 void Debug::SetHostDispatchHandler(v8::DebugHostDispatchHandler handler, | 3279 void Debug::SetHostDispatchHandler(HostDispatchHandler handler) { |
3278 void* data) { | |
3279 EnsureInitialized("v8::Debug::SetHostDispatchHandler"); | 3280 EnsureInitialized("v8::Debug::SetHostDispatchHandler"); |
3280 ENTER_V8; | 3281 ENTER_V8; |
3281 i::Debugger::SetHostDispatchHandler(handler, data); | 3282 i::Debugger::SetHostDispatchHandler(handler); |
3282 } | 3283 } |
3283 | 3284 |
3284 | 3285 |
3285 void Debug::SendHostDispatch(void* dispatch) { | 3286 void Debug::SendHostDispatch(ClientData* dispatch) { |
3286 if (!i::V8::HasBeenSetup()) return; | 3287 if (!i::V8::HasBeenSetup()) return; |
3287 i::Debugger::ProcessHostDispatch(dispatch); | 3288 i::Debugger::ProcessHostDispatch(dispatch); |
3288 } | 3289 } |
3289 | 3290 |
3290 | 3291 |
3291 Handle<Value> Debug::Call(v8::Handle<v8::Function> fun, | 3292 Handle<Value> Debug::Call(v8::Handle<v8::Function> fun, |
3292 v8::Handle<v8::Value> data) { | 3293 v8::Handle<v8::Value> data) { |
3293 if (!i::V8::HasBeenSetup()) return Handle<Value>(); | 3294 if (!i::V8::HasBeenSetup()) return Handle<Value>(); |
3294 ON_BAILOUT("v8::Debug::Call()", return Handle<Value>()); | 3295 ON_BAILOUT("v8::Debug::Call()", return Handle<Value>()); |
3295 ENTER_V8; | 3296 ENTER_V8; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3388 reinterpret_cast<HandleScopeImplementer*>(storage); | 3389 reinterpret_cast<HandleScopeImplementer*>(storage); |
3389 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); | 3390 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); |
3390 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = | 3391 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = |
3391 &thread_local->handle_scope_data_; | 3392 &thread_local->handle_scope_data_; |
3392 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); | 3393 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); |
3393 | 3394 |
3394 return storage + ArchiveSpacePerThread(); | 3395 return storage + ArchiveSpacePerThread(); |
3395 } | 3396 } |
3396 | 3397 |
3397 } } // namespace v8::internal | 3398 } } // namespace v8::internal |
OLD | NEW |