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 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 i::Handle<i::Object> result = i::Factory::NewError(message); | 3173 i::Handle<i::Object> result = i::Factory::NewError(message); |
3174 error = *result; | 3174 error = *result; |
3175 } | 3175 } |
3176 i::Handle<i::Object> result(error); | 3176 i::Handle<i::Object> result(error); |
3177 return Utils::ToLocal(result); | 3177 return Utils::ToLocal(result); |
3178 } | 3178 } |
3179 | 3179 |
3180 | 3180 |
3181 // --- D e b u g S u p p o r t --- | 3181 // --- D e b u g S u p p o r t --- |
3182 | 3182 |
3183 | 3183 #ifdef ENABLE_DEBUGGER_SUPPORT |
3184 bool Debug::SetDebugEventListener(DebugEventCallback that, Handle<Value> data) { | 3184 bool Debug::SetDebugEventListener(DebugEventCallback that, Handle<Value> data) { |
3185 EnsureInitialized("v8::Debug::SetDebugEventListener()"); | 3185 EnsureInitialized("v8::Debug::SetDebugEventListener()"); |
3186 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); | 3186 ON_BAILOUT("v8::Debug::SetDebugEventListener()", return false); |
3187 ENTER_V8; | 3187 ENTER_V8; |
3188 HandleScope scope; | 3188 HandleScope scope; |
3189 i::Handle<i::Object> proxy = i::Factory::undefined_value(); | 3189 i::Handle<i::Object> proxy = i::Factory::undefined_value(); |
3190 if (that != NULL) { | 3190 if (that != NULL) { |
3191 proxy = i::Factory::NewProxy(FUNCTION_ADDR(that)); | 3191 proxy = i::Factory::NewProxy(FUNCTION_ADDR(that)); |
3192 } | 3192 } |
3193 i::Debugger::SetEventListener(proxy, Utils::OpenHandle(*data)); | 3193 i::Debugger::SetEventListener(proxy, Utils::OpenHandle(*data)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3256 &has_pending_exception); | 3256 &has_pending_exception); |
3257 } | 3257 } |
3258 EXCEPTION_BAILOUT_CHECK(Local<Value>()); | 3258 EXCEPTION_BAILOUT_CHECK(Local<Value>()); |
3259 return Utils::ToLocal(result); | 3259 return Utils::ToLocal(result); |
3260 } | 3260 } |
3261 | 3261 |
3262 | 3262 |
3263 bool Debug::EnableAgent(const char* name, int port) { | 3263 bool Debug::EnableAgent(const char* name, int port) { |
3264 return i::Debugger::StartAgent(name, port); | 3264 return i::Debugger::StartAgent(name, port); |
3265 } | 3265 } |
3266 | 3266 #endif // ENABLE_DEBUGGER_SUPPORT |
3267 | 3267 |
3268 namespace internal { | 3268 namespace internal { |
3269 | 3269 |
3270 | 3270 |
3271 HandleScopeImplementer* HandleScopeImplementer::instance() { | 3271 HandleScopeImplementer* HandleScopeImplementer::instance() { |
3272 return &thread_local; | 3272 return &thread_local; |
3273 } | 3273 } |
3274 | 3274 |
3275 | 3275 |
3276 char* HandleScopeImplementer::ArchiveThread(char* storage) { | 3276 char* HandleScopeImplementer::ArchiveThread(char* storage) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3339 reinterpret_cast<HandleScopeImplementer*>(storage); | 3339 reinterpret_cast<HandleScopeImplementer*>(storage); |
3340 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); | 3340 List<void**>* blocks_of_archived_thread = thread_local->Blocks(); |
3341 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = | 3341 v8::ImplementationUtilities::HandleScopeData* handle_data_of_archived_thread = |
3342 &thread_local->handle_scope_data_; | 3342 &thread_local->handle_scope_data_; |
3343 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); | 3343 Iterate(v, blocks_of_archived_thread, handle_data_of_archived_thread); |
3344 | 3344 |
3345 return storage + ArchiveSpacePerThread(); | 3345 return storage + ArchiveSpacePerThread(); |
3346 } | 3346 } |
3347 | 3347 |
3348 } } // namespace v8::internal | 3348 } } // namespace v8::internal |
OLD | NEW |