| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 RELEASE_ASSERT(!context->isIteratingOverObservers()); | 622 RELEASE_ASSERT(!context->isIteratingOverObservers()); |
| 623 | 623 |
| 624 if (ScriptForbiddenScope::isScriptForbidden()) { | 624 if (ScriptForbiddenScope::isScriptForbidden()) { |
| 625 throwScriptForbiddenException(isolate); | 625 throwScriptForbiddenException(isolate); |
| 626 return v8::MaybeLocal<v8::Value>(); | 626 return v8::MaybeLocal<v8::Value>(); |
| 627 } | 627 } |
| 628 if (!depth) | 628 if (!depth) |
| 629 TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", | 629 TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", |
| 630 InspectorFunctionCallEvent::data(context, function)); | 630 InspectorFunctionCallEvent::data(context, function)); |
| 631 | 631 |
| 632 CHECK(!ThreadState::current()->isWrapperTracingForbidden()); |
| 632 v8::MicrotasksScope microtasksScope(isolate, | 633 v8::MicrotasksScope microtasksScope(isolate, |
| 633 v8::MicrotasksScope::kRunMicrotasks); | 634 v8::MicrotasksScope::kRunMicrotasks); |
| 634 PerformanceMonitor::willCallFunction(context); | 635 PerformanceMonitor::willCallFunction(context); |
| 635 ThreadDebugger::willExecuteScript(isolate, function->ScriptId()); | 636 ThreadDebugger::willExecuteScript(isolate, function->ScriptId()); |
| 636 v8::MaybeLocal<v8::Value> result = | 637 v8::MaybeLocal<v8::Value> result = |
| 637 function->Call(isolate->GetCurrentContext(), receiver, argc, args); | 638 function->Call(isolate->GetCurrentContext(), receiver, argc, args); |
| 638 crashIfIsolateIsDead(isolate); | 639 crashIfIsolateIsDead(isolate); |
| 639 ThreadDebugger::didExecuteScript(isolate); | 640 ThreadDebugger::didExecuteScript(isolate); |
| 640 PerformanceMonitor::didCallFunction(context, function); | 641 PerformanceMonitor::didCallFunction(context, function); |
| 641 if (!depth) | 642 if (!depth) |
| 642 TRACE_EVENT_END0("devtools.timeline", "FunctionCall"); | 643 TRACE_EVENT_END0("devtools.timeline", "FunctionCall"); |
| 643 return result; | 644 return result; |
| 644 } | 645 } |
| 645 | 646 |
| 646 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction( | 647 v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction( |
| 647 v8::Local<v8::Function> function, | 648 v8::Local<v8::Function> function, |
| 648 v8::Local<v8::Value> receiver, | 649 v8::Local<v8::Value> receiver, |
| 649 int argc, | 650 int argc, |
| 650 v8::Local<v8::Value> args[], | 651 v8::Local<v8::Value> args[], |
| 651 v8::Isolate* isolate) { | 652 v8::Isolate* isolate) { |
| 652 TRACE_EVENT0("v8", "v8.callFunction"); | 653 TRACE_EVENT0("v8", "v8.callFunction"); |
| 654 CHECK(!ThreadState::current()->isWrapperTracingForbidden()); |
| 653 v8::MicrotasksScope microtasksScope(isolate, | 655 v8::MicrotasksScope microtasksScope(isolate, |
| 654 v8::MicrotasksScope::kDoNotRunMicrotasks); | 656 v8::MicrotasksScope::kDoNotRunMicrotasks); |
| 655 v8::MaybeLocal<v8::Value> result = | 657 v8::MaybeLocal<v8::Value> result = |
| 656 function->Call(isolate->GetCurrentContext(), receiver, argc, args); | 658 function->Call(isolate->GetCurrentContext(), receiver, argc, args); |
| 657 crashIfIsolateIsDead(isolate); | 659 crashIfIsolateIsDead(isolate); |
| 658 return result; | 660 return result; |
| 659 } | 661 } |
| 660 | 662 |
| 661 v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObject( | 663 v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObject( |
| 662 v8::Isolate* isolate, | 664 v8::Isolate* isolate, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 v8AtomicString(isolate, "((e) => { throw e; })"), origin) | 745 v8AtomicString(isolate, "((e) => { throw e; })"), origin) |
| 744 .ToLocalChecked(); | 746 .ToLocalChecked(); |
| 745 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) | 747 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) |
| 746 .ToLocalChecked() | 748 .ToLocalChecked() |
| 747 .As<v8::Function>(); | 749 .As<v8::Function>(); |
| 748 v8::Local<v8::Value> args[] = {exception}; | 750 v8::Local<v8::Value> args[] = {exception}; |
| 749 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); | 751 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); |
| 750 } | 752 } |
| 751 | 753 |
| 752 } // namespace blink | 754 } // namespace blink |
| OLD | NEW |