OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 2884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2895 i::Debugger::SetMessageHandler(handler, data); | 2895 i::Debugger::SetMessageHandler(handler, data); |
2896 } | 2896 } |
2897 | 2897 |
2898 | 2898 |
2899 void Debug::SendCommand(const uint16_t* command, int length) { | 2899 void Debug::SendCommand(const uint16_t* command, int length) { |
2900 if (!i::V8::HasBeenSetup()) return; | 2900 if (!i::V8::HasBeenSetup()) return; |
2901 i::Debugger::ProcessCommand(i::Vector<const uint16_t>(command, length)); | 2901 i::Debugger::ProcessCommand(i::Vector<const uint16_t>(command, length)); |
2902 } | 2902 } |
2903 | 2903 |
2904 | 2904 |
| 2905 Handle<Value> Debug::Call(v8::Handle<v8::Function> fun, |
| 2906 v8::Handle<v8::Value> data) { |
| 2907 if (!i::V8::HasBeenSetup()) return Handle<Value>(); |
| 2908 ON_BAILOUT("v8::Debug::Call()", return Handle<Value>()); |
| 2909 i::Handle<i::Object> result; |
| 2910 EXCEPTION_PREAMBLE(); |
| 2911 if (data.IsEmpty()) { |
| 2912 result = i::Debugger::Call(Utils::OpenHandle(*fun), |
| 2913 i::Factory::undefined_value(), |
| 2914 &has_pending_exception); |
| 2915 } else { |
| 2916 result = i::Debugger::Call(Utils::OpenHandle(*fun), |
| 2917 Utils::OpenHandle(*data), |
| 2918 &has_pending_exception); |
| 2919 } |
| 2920 EXCEPTION_BAILOUT_CHECK(Local<Value>()); |
| 2921 return Utils::ToLocal(result); |
| 2922 } |
| 2923 |
| 2924 |
2905 namespace internal { | 2925 namespace internal { |
2906 | 2926 |
2907 | 2927 |
2908 HandleScopeImplementer* HandleScopeImplementer::instance() { | 2928 HandleScopeImplementer* HandleScopeImplementer::instance() { |
2909 return &thread_local; | 2929 return &thread_local; |
2910 } | 2930 } |
2911 | 2931 |
2912 | 2932 |
2913 char* HandleScopeImplementer::ArchiveThread(char* storage) { | 2933 char* HandleScopeImplementer::ArchiveThread(char* storage) { |
2914 return thread_local.ArchiveThreadHelper(storage); | 2934 return thread_local.ArchiveThreadHelper(storage); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 reinterpret_cast<HandleScopeImplementer*>(storage); | 2996 reinterpret_cast<HandleScopeImplementer*>(storage); |
2977 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); | 2997 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); |
2978 ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = | 2998 ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = |
2979 &thread_local->handle_scope_data_; | 2999 &thread_local->handle_scope_data_; |
2980 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); | 3000 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); |
2981 | 3001 |
2982 return storage + ArchiveSpacePerThread(); | 3002 return storage + ArchiveSpacePerThread(); |
2983 } | 3003 } |
2984 | 3004 |
2985 } } // namespace v8::internal | 3005 } } // namespace v8::internal |
OLD | NEW |