Home | History | Annotate | Download | only in src

Lines Matching full:handle

31     : debug_context_(Handle<Context>()),
32 event_listener_(Handle<Object>()),
33 event_listener_data_(Handle<Object>()),
52 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) {
53 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
57 Handle<Context> native_context(context->native_context());
62 BreakLocationIterator::BreakLocationIterator(Handle<DebugInfo> debug_info,
269 void BreakLocationIterator::SetBreakPoint(Handle<Object> break_point_object) {
281 void BreakLocationIterator::ClearBreakPoint(Handle<Object> break_point_object) {
371 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
387 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
390 Handle<Code> maybe_call_function_stub = target_code;
394 Handle<Code>(Code::GetCodeFromTargetAddress(original_target));
439 static Handle<Code> DebugBreakForIC(Handle<Code> code, RelocInfo::Mode mode) {
481 return Handle<Code>::null();
493 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
497 Handle<Code> dbgbrk_code = DebugBreakForIC(target_code, mode);
608 Add(Handle<Script>(Script::cast(obj)));
614 void ScriptCache::Add(Handle<Script> script) {
624 Handle<Script> found(reinterpret_cast<Script**>(entry->value));
632 // global handle as the value in the hash map.
633 Handle<Script> script_ =
634 Handle<Script>::cast(global_handles->Create(*script));
642 Handle<FixedArray> ScriptCache::GetScripts() {
644 Handle<FixedArray> instances = factory->NewFixedArray(occupancy());
674 Handle<Object> object = Utils::OpenHandle(*data.GetValue());
675 int id = Handle<Script>::cast(object)->id()->value();
686 // Clear the weak handle.
716 debug_info_ = Handle<DebugInfo>::cast(global_handles->Create(debug_info));
736 Handle<String> source_code =
739 Handle<String> script_name =
741 Handle<Context> context = isolate->native_context();
744 Handle<SharedFunctionInfo> function_info;
757 Handle<JSFunction> function =
762 function, handle(context->global_proxy()), 0, NULL, &maybe_exception);
769 Handle<Object> message = MessageHandler::MakeMessageObject(
771 Vector<Handle<Object> >::empty(), Handle<JSArray>());
773 Handle<Object> exception;
783 Handle<Script> script(Script::cast(function->shared()->script()));
806 Handle<Context> context =
809 v8::Handle<ObjectTemplate>(),
820 Handle<String> key = isolate_->factory()->InternalizeOneByteString(
822 Handle<GlobalObject> global =
823 Handle<GlobalObject>(context->global_object(), isolate_);
824 Handle<JSBuiltinsObject> builtin =
825 Handle<JSBuiltinsObject>(global->builtins(), isolate_);
841 debug_context_ = Handle<Context>::cast(
860 // Clear debugger context global handle.
861 GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location());
862 debug_context_ = Handle<Context>();
885 Handle<SharedFunctionInfo> shared =
886 Handle<SharedFunctionInfo>(frame->function()->shared());
887 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
906 Handle<Object> break_points_hit(heap->undefined_value(), isolate_);
908 Handle<Object> break_point_objects =
909 Handle<Object>(break_location_iterator.BreakPointObjects(), isolate_);
991 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) {
996 Handle<FixedArray> break_points_hit;
1000 Handle<FixedArray> array(FixedArray::cast(*break_point_objects));
1003 Handle<Object> o(array->get(i), isolate_);
1020 Handle<JSArray> result = factory->NewJSArrayWithElements(break_points_hit);
1027 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
1035 Handle<String> is_break_point_triggered_string =
1038 Handle<GlobalObject> debug_global(debug_context()->global_object());
1039 Handle<JSFunction> check_break_point =
1040 Handle<JSFunction>::cast(Object::GetProperty(
1044 Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id());
1047 Handle<Object> argv[] = { break_id, break_point_object };
1048 Handle<Object> result;
1062 bool Debug::HasDebugInfo(Handle<SharedFunctionInfo> shared) {
1069 Handle<DebugInfo> Debug::GetDebugInfo(Handle<SharedFunctionInfo> shared) {
1071 return Handle<DebugInfo>(DebugInfo::cast(shared->debug_info()));
1075 bool Debug::SetBreakPoint(Handle<JSFunction> function,
1076 Handle<Object> break_point_object,
1083 Handle<SharedFunctionInfo> shared(function->shared());
1089 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
1105 bool Debug::SetBreakPointForScript(Handle<Script> script,
1106 Handle<Object> break_point_object,
1118 Handle<SharedFunctionInfo> shared(SharedFunctionInfo::cast(result));
1119 if (!EnsureDebugInfo(shared, Handle<JSFunction>::null())) {
1133 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
1150 void Debug::ClearBreakPoint(Handle<Object> break_point_object) {
1160 Handle<DebugInfo> debug_info = node->debug_info();
1197 void Debug::FloodWithOneShot(Handle<JSFunction> function) {
1201 Handle<SharedFunctionInfo> shared(function->shared());
1216 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) {
1217 Handle<FixedArray> new_bindings(function->function_bindings());
1218 Handle<Object> bindee(new_bindings->get(JSFunction::kBoundFunctionIndex),
1223 Handle<JSFunction> bindee_function(JSFunction::cast(*bindee));
1240 FloodWithOneShot(Handle<JSFunction>(frame->function()));
1265 bool Debug::PromiseHasRejectHandler(Handle<JSObject> promise) {
1266 Handle<JSFunction> fun = Handle<JSFunction>::cast(
1270 Handle<Object> result =
1323 FloodWithOneShot(Handle<JSFunction>(function));
1328 Handle<JSFunction> function(frame->function());
1329 Handle<SharedFunctionInfo> shared(function->shared());
1334 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
1346 Handle<Code> call_function_stub;
1376 call_function_stub = Handle<Code>(maybe_call_function_stub);
1404 FloodWithOneShot(Handle<JSFunction>(function));
1416 // Remember source position and frame to handle step next.
1424 Handle<JSFunction> restarted_function(
1471 Handle<JSFunction> js_function(JSFunction::cast(fun));
1489 // Remember source position and frame to handle step in getter/setter. If
1551 Handle<Object> Debug::GetSourceBreakLocations(
1552 Handle<SharedFunctionInfo> shared,
1557 return Handle<Object>(heap->undefined_value(), isolate);
1559 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
1561 return Handle<Object>(heap->undefined_value(), isolate);
1563 Handle<FixedArray> locations =
1592 // Handle stepping into a function.
1593 void Debug::HandleStepIn(Handle<JSFunction> function,
1594 Handle<Object> holder,
1614 // Handle Function.prototype.bind
1622 // Handle function.apply and function.call separately to flood the
1627 Handle<JSFunction> js_function = Handle<JSFunction>::cast(holder);
1631 // Handle Function.prototype.bind
1707 List<Handle<JSFunction> >* active_functions,
1720 active_functions->Add(Handle<JSFunction>(function));
1726 active_functions->Add(Handle<JSFunction>(function));
1798 Handle<Code> frame_code(frame->LookupCode());
1801 Handle<Code> new_code(function->shared()->code());
1848 explicit ActiveFunctionsCollector(List<Handle<JSFunction> >* active_functions,
1861 List<Handle<JSFunction> >* active_functions_;
1874 static void EnsureFunctionHasDebugBreakSlots(Handle<JSFunction> function) {
1894 const List<Handle<JSGeneratorObject> > &generators) {
1896 Handle<JSFunction> fun(generators[i]->function());
1917 Handle<Code> lazy_compile = isolate_->builtins()->CompileLazy();
1924 List<Handle
1927 List<Handle<JSGeneratorObject> > suspended_generators;
1939 List<Handle<JSFunction> > generator_functions;
1979 generator_functions.Add(Handle<JSFunction>(function, isolate_));
2019 suspended_generators.Add(Handle<JSGeneratorObject>(gen, isolate_));
2025 Handle<JSFunction> function = active_functions[i];
2037 Handle<JSFunction> &function = generator_functions[i];
2050 Handle<JSFunction> function = active_functions[i];
2051 Handle<SharedFunctionInfo> shared(function->shared());
2071 Object* Debug::FindSharedFunctionInfoInScript(Handle<Script> script,
2087 Handle<JSFunction> target_function;
2088 Handle<SharedFunctionInfo> target;
2096 Handle<JSFunction> function;
2097 Handle<SharedFunctionInfo> shared;
2099 function = Handle<JSFunction>(JSFunction::cast(obj));
2100 shared = Handle<SharedFunctionInfo>(function->shared());
2104 shared = Handle<SharedFunctionInfo>(SharedFunctionInfo::cast(obj));
2177 bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
2178 Handle<JSFunction> function) {
2197 Handle<DebugInfo> debug_info = isolate->factory()->NewDebugInfo(shared);
2208 void Debug::RemoveDebugInfo(Handle<DebugInfo> debug_info) {
2248 Handle<JSFunction> function(JSFunction::cast(frame->function()));
2249 Handle<SharedFunctionInfo> shared(function->shared());
2254 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
2255 Handle<Code> code(debug_info->code());
2256 Handle<Code> original_code(debug_info->original_code());
2259 Handle<Code> frame_code(frame->LookupCode());
2286 // Handle the jump to continue execution after break point depending on the
2342 Handle<JSFunction> function(JSFunction::cast(frame->function()));
2343 Handle<SharedFunctionInfo> shared(function->shared());
2348 Handle<DebugInfo> debug_info = GetDebugInfo(shared);
2349 Handle<Code> code(debug_info->code());
2352 Handle<Code> frame_code(frame->LookupCode());
2394 Handle<GlobalObject> global(isolate_->global_object());
2397 handle(Smi::FromInt(0), isolate_), SLOPPY).Check();
2404 Handle<FixedArray> Debug::GetLoadedScripts() {
2419 void Debug::RecordEvalCaller(Handle<Script> script) {
2436 Handle<Object> argv[]) {
2439 Handle<GlobalObject> global(isolate_->global_object());
2440 Handle<Object> constructor = Object::GetProperty(
2444 // We do not handle interrupts here. In particular, termination interrupts.
2446 return Execution::TryCall(Handle<JSFunction>::cast(constructor),
2447 handle(debug_context()->global_proxy()),
2455 Handle<Object> argv[] = { isolate_->factory()->NewNumberFromInt(break_id()) };
2460 MaybeHandle<Object> Debug::MakeBreakEvent(Handle<Object> break_points_hit) {
2462 Handle<Object> argv[] = { isolate_->factory()->NewNumberFromInt(break_id()),
2468 MaybeHandle<Object> Debug::MakeExceptionEvent(Handle<Object> exception,
2470 Handle<Object> promise) {
2472 Handle<Object> argv[] = { isolate_->factory()->NewNumberFromInt(break_id()),
2480 MaybeHandle<Object> Debug::MakeCompileEvent(Handle<Script> script,
2483 Handle<Object> script_wrapper = Script::GetWrapper(script);
2484 Handle<Object> argv[] = { script_wrapper,
2490 MaybeHandle<Object> Debug::MakePromiseEvent(Handle<JSObject> event_data) {
2492 Handle<Object> argv[] = { event_data };
2497 MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) {
2499 Handle<Object> argv[] = { task_event };
2504 void Debug::OnThrow(Handle<Object> exception, bool uncaught) {
2509 Handle<Object> scheduled_exception;
2511 scheduled_exception = handle(isolate_->scheduled_exception(), isolate_);
2521 void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) {
2528 void Debug::OnException(Handle<Object> exception, bool uncaught,
2529 Handle<Object> promise) {
2531 uncaught |= !PromiseHasRejectHandler(Handle<JSObject>::cast(promise));
2549 Handle<Object> event_data;
2557 ProcessDebugEvent(v8::Exception, Handle<JSObject>::cast(event_data), false);
2562 void Debug::OnCompileError(Handle<Script> script) {
2571 Handle<Object> event_data;
2576 ProcessDebugEvent(v8::CompileError, Handle<JSObject>::cast(event_data), true);
2580 void Debug::OnDebugBreak(Handle<Object> break_points_hit,
2589 Handle<Object> event_data;
2595 Handle<JSObject>::cast(event_data),
2600 void Debug::OnBeforeCompile(Handle<Script> script) {
2608 Handle<Object> event_data;
2615 Handle<JSObject>::cast(event_data),
2620 // Handle debugger actions when a new script is compiled.
2621 void Debug::OnAfterCompile(Handle<Script> script) {
2636 Handle<String> update_script_break_points_string =
2639 Handle<GlobalObject> debug_global(debug_context()->global_object());
2640 Handle<Object> update_script_break_points =
2650 Handle<Object> wrapper = Script::GetWrapper(script);
2653 Handle<Object> argv[] = { wrapper };
2654 if (Execution::TryCall(Handle<JSFunction>::cast(update_script_break_points),
2662 Handle<Object> event_data;
2667 ProcessDebugEvent(v8::AfterCompile, Handle<JSObject>::cast(event_data), true);
2671 void Debug::OnPromiseEvent(Handle<JSObject> data) {
2679 Handle<Object> event_data;
2685 Handle<JSObject>::cast(event_data),
2690 void Debug::OnAsyncTaskEvent(Handle<JSObject> data) {
2698 Handle<Object> event_data;
2704 Handle<JSObject>::cast(event_data),
2710 Handle<JSObject> event_data,
2715 Handle<Object> exec_state;
2722 Handle<JSObject>::cast(exec_state),
2749 Handle<Object> exec_state,
2750 Handle<Object> event_data,
2756 Handle<Foreign>::cast(event_listener_)->foreign_address());
2758 Handle<JSObject>::cast(exec_state),
2759 Handle<JSObject>::cast(event_data),
2767 Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event), isolate_),
2771 Handle
2772 Execution::TryCall(Handle<JSFunction>::cast(event_listener_),
2778 Handle<Context> Debug::GetDebugContext() {
2780 // The global handle may be destroyed soon after. Return it reboxed.
2781 return handle(*debug_context(), isolate_);
2786 Handle<JSObject> exec_state,
2787 Handle<JSObject> event_data,
2827 Handle<JSObject>::cast(exec_state),
2828 Handle<JSObject>::cast(event_data));
2841 Handle<Object> cmd_processor_ctor = Object::GetProperty(
2843 Handle<Object> ctor_args[] = { isolate_->factory()->ToBoolean(running) };
2844 Handle<Object> cmd_processor = Execution::Call(
2846 Handle<JSFunction> process_debug_request = Handle<JSFunction>::cast(
2849 Handle<Object> is_running = Object::GetProperty(
2870 Handle<String> request_text = isolate_->factory()->NewStringFromTwoByte(
2872 Handle<Object> request_args[] = { request_text };
2873 Handle<Object> answer_value;
2874 Handle<String> answer;
2884 answer = Handle<String>::cast(answer_value);
2893 Handle<Object> is_running_args[] = { answer };
2896 Handle<Object> result;
2900 Handle<Object> exception;
2902 Handle<Object> result;
2904 answer = Handle<String>::cast(result);
2921 void Debug::SetEventListener(Handle<Object> callback,
2922 Handle<Object> data) {
2927 event_listener_ = Handle<Object>();
2929 event_listener_data_ = Handle<Object>();
3004 MaybeHandle<Object> Debug::Call(Handle<JSFunction> fun, Handle<Object> data) {
3009 Handle<Object> exec_state;
3014 Handle<Object> argv[] = { exec_state, data };
3018 Handle<Object>(debug_context()->global_proxy(), isolate_),
3129 Handle<JSObject> exec_state,
3130 Handle<JSObject> event_data) {
3132 exec_state, event_data, Handle<String>(), NULL);
3139 Handle<JSObject> exec_state,
3140 Handle<JSObject> event_data,
3141 Handle<String> response_json,
3152 Handle<JSObject> exec_state,
3153 Handle<JSObject> event_data,
3154 Handle<String> response_json,
3185 v8::Handle<v8::Object> MessageImpl::GetExecutionState() const {
3195 v8::Handle<v8::Object> MessageImpl::GetEventData() const {
3200 v8::Handle<v8::String> MessageImpl::GetJSON() const {
3206 Handle<Object> fun = Object::GetProperty(
3209 return v8::Handle<v8::String>();
3213 Execution::TryCall(Handle<JSFunction>::cast(fun), event_data_, 0, NULL);
3214 Handle<Object> json;
3216 return v8::Handle<v8::String>();
3218 return scope.Escape(v8::Utils::ToLocal(Handle<String>::cast(json)));
3225 v8::Handle<v8::Context> MessageImpl::GetEventContext() const {
3227 v8::Handle<v8::Context> context = GetDebugEventContext(isolate);
3240 Handle<JSObject> exec_state,
3241 Handle<JSObject> event_data,
3242 Handle<Object> callback_data,
3256 v8::Handle<v8::Object> EventDetailsImpl::GetExecutionState() const {
3261 v8::Handle<v8::Object> EventDetailsImpl::GetEventData() const {
3266 v8::Handle<v8::Context> EventDetailsImpl::GetEventContext() const {
3271 v8::Handle