OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6802 i::Handle<i::Object> result = isolate->factory()->NewError(message); | 6802 i::Handle<i::Object> result = isolate->factory()->NewError(message); |
6803 error = *result; | 6803 error = *result; |
6804 } | 6804 } |
6805 i::Handle<i::Object> result(error, isolate); | 6805 i::Handle<i::Object> result(error, isolate); |
6806 return Utils::ToLocal(result); | 6806 return Utils::ToLocal(result); |
6807 } | 6807 } |
6808 | 6808 |
6809 | 6809 |
6810 // --- D e b u g S u p p o r t --- | 6810 // --- D e b u g S u p p o r t --- |
6811 | 6811 |
6812 #ifdef ENABLE_DEBUGGER_SUPPORT | |
6813 | |
6814 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { | 6812 bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) { |
6815 i::Isolate* isolate = i::Isolate::Current(); | 6813 i::Isolate* isolate = i::Isolate::Current(); |
6816 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); | 6814 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()"); |
6817 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); | 6815 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false); |
6818 ENTER_V8(isolate); | 6816 ENTER_V8(isolate); |
6819 i::HandleScope scope(isolate); | 6817 i::HandleScope scope(isolate); |
6820 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); | 6818 i::Handle<i::Object> foreign = isolate->factory()->undefined_value(); |
6821 if (that != NULL) { | 6819 if (that != NULL) { |
6822 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); | 6820 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
6823 } | 6821 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6968 return Utils::ToLocal(i::Isolate::Current()->debugger()->GetDebugContext()); | 6966 return Utils::ToLocal(i::Isolate::Current()->debugger()->GetDebugContext()); |
6969 } | 6967 } |
6970 | 6968 |
6971 | 6969 |
6972 void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) { | 6970 void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) { |
6973 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 6971 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
6974 internal_isolate->debugger()->set_live_edit_enabled(enable); | 6972 internal_isolate->debugger()->set_live_edit_enabled(enable); |
6975 } | 6973 } |
6976 | 6974 |
6977 | 6975 |
6978 #endif // ENABLE_DEBUGGER_SUPPORT | |
6979 | |
6980 | |
6981 Handle<String> CpuProfileNode::GetFunctionName() const { | 6976 Handle<String> CpuProfileNode::GetFunctionName() const { |
6982 i::Isolate* isolate = i::Isolate::Current(); | 6977 i::Isolate* isolate = i::Isolate::Current(); |
6983 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 6978 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
6984 const i::CodeEntry* entry = node->entry(); | 6979 const i::CodeEntry* entry = node->entry(); |
6985 i::Handle<i::String> name = | 6980 i::Handle<i::String> name = |
6986 isolate->factory()->InternalizeUtf8String(entry->name()); | 6981 isolate->factory()->InternalizeUtf8String(entry->name()); |
6987 if (!entry->has_name_prefix()) { | 6982 if (!entry->has_name_prefix()) { |
6988 return ToApiHandle<String>(name); | 6983 return ToApiHandle<String>(name); |
6989 } else { | 6984 } else { |
6990 // We do not expect this to fail. Change this if it does. | 6985 // We do not expect this to fail. Change this if it does. |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7614 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7609 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7615 Address callback_address = | 7610 Address callback_address = |
7616 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7611 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7617 VMState<EXTERNAL> state(isolate); | 7612 VMState<EXTERNAL> state(isolate); |
7618 ExternalCallbackScope call_scope(isolate, callback_address); | 7613 ExternalCallbackScope call_scope(isolate, callback_address); |
7619 callback(info); | 7614 callback(info); |
7620 } | 7615 } |
7621 | 7616 |
7622 | 7617 |
7623 } } // namespace v8::internal | 7618 } } // namespace v8::internal |
OLD | NEW |