| Index: Source/bindings/dart/DartInjectedScript.cpp
|
| diff --git a/Source/bindings/dart/DartInjectedScript.cpp b/Source/bindings/dart/DartInjectedScript.cpp
|
| index 1db544cb97232e05f7bd4c0a257ad3cfecb849ef..3c0552533be1264f2b4e7aaf68fa32e0c63a59da 100644
|
| --- a/Source/bindings/dart/DartInjectedScript.cpp
|
| +++ b/Source/bindings/dart/DartInjectedScript.cpp
|
| @@ -57,6 +57,8 @@ using WebCore::TypeBuilder::Runtime::PropertyPreview;
|
|
|
| namespace WebCore {
|
|
|
| +static const uint64_t kMaxSafeIntegerForDouble = 0x1fffffffffffffUL;
|
| +
|
| Dart_Handle getLibraryUrl(Dart_Handle handle)
|
| {
|
| intptr_t libraryId = 0;
|
| @@ -744,7 +746,7 @@ void DartInjectedScript::restartFrame(ErrorString* errorString, const StackTrace
|
|
|
| void DartInjectedScript::getStepInPositions(ErrorString* errorString, const StackTrace& callFrames, const String& callFrameId, RefPtr<Array<TypeBuilder::Debugger::Location> >& positions)
|
| {
|
| - ASSERT(!callFrames.isJavaScript());
|
| + ASSERT(callFrames.isJavaScript());
|
| if (!m_scriptState) {
|
| *errorString = "Invalid DartInjectedScript";
|
| return;
|
| @@ -757,13 +759,13 @@ void DartInjectedScript::getStepInPositions(ErrorString* errorString, const Stac
|
|
|
| void DartInjectedScript::setVariableValue(ErrorString* errorString, const StackTrace& callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, const String& variableName, const String& newValueStr)
|
| {
|
| + ASSERT(callFrames.isJavaScript());
|
| if (!m_scriptState) {
|
| *errorString = "Invalid DartInjectedScript";
|
| return;
|
| }
|
| DartIsolateScope scope(m_scriptState->isolate());
|
| DartApiScope apiScope;
|
| - ASSERT(!callFrames.isJavaScript());
|
| *errorString = "Not supported by Dart.";
|
| return;
|
| }
|
| @@ -843,7 +845,7 @@ void addCompletions(Dart_Handle completions, RefPtr<TypeBuilder::Array<String> >
|
|
|
| void DartInjectedScript::getCompletionsOnCallFrame(ErrorString* errorString, const StackTrace& callFrames, const Vector<StackTrace>& asyncCallStacks, const String& callFrameId, const String& expression, RefPtr<TypeBuilder::Array<String> >* result)
|
| {
|
| - ASSERT(!callFrames.isJavaScript());
|
| + ASSERT(callFrames.isJavaScript());
|
| *result = TypeBuilder::Array<String>::create();
|
| if (!m_scriptState) {
|
| *errorString = "Invalid DartInjectedScript";
|
| @@ -1215,8 +1217,9 @@ Dart_ActivationFrame DartInjectedScript::callFrameForId(const StackTrace& callFr
|
| if (asyncOrdinal > 0) { // 1-based index
|
| ASSERT(asyncOrdinal <= (int)asyncCallStacks.size());
|
| if (asyncOrdinal <= (int)asyncCallStacks.size()) {
|
| - ASSERT(!asyncCallStacks[asyncOrdinal-1].isJavaScript());
|
| - result = Dart_GetActivationFrame(asyncCallStacks[asyncOrdinal-1].asDart(), ordinal, &frame);
|
| + StackTrace asyncCallStack = asyncCallStacks[asyncOrdinal-1];
|
| + ASSERT(!asyncCallStack.isJavaScript());
|
| + result = Dart_GetActivationFrame(asyncCallStack.asDart(), ordinal, &frame);
|
| } else {
|
| return 0;
|
| }
|
| @@ -1232,6 +1235,8 @@ PassRefPtr<Array<CallFrame> > DartInjectedScript::wrapCallFrames(const StackTrac
|
| ASSERT(!callFrames.isJavaScript());
|
| if (callFrames.isJavaScript())
|
| return nullptr;
|
| + DartIsolateScope scope(m_scriptState->isolate());
|
| + DartApiScope apiScope;
|
| Dart_StackTrace trace = callFrames.asDart();
|
| intptr_t length = 0;
|
| Dart_Handle ALLOW_UNUSED result;
|
| @@ -1240,6 +1245,7 @@ PassRefPtr<Array<CallFrame> > DartInjectedScript::wrapCallFrames(const StackTrac
|
| ASSERT(!Dart_IsError(result));
|
| DartScriptDebugServer& debugServer = DartScriptDebugServer::shared();
|
| Dart_Handle libraries = Dart_GetLibraryIds();
|
| +
|
| for (intptr_t i = 0; i < length; i++) {
|
| Dart_ActivationFrame frame = 0;
|
| result = Dart_GetActivationFrame(trace, i, &frame);
|
| @@ -1247,7 +1253,9 @@ PassRefPtr<Array<CallFrame> > DartInjectedScript::wrapCallFrames(const StackTrac
|
| Dart_Handle functionName = 0;
|
| Dart_Handle function = 0;
|
| Dart_CodeLocation location;
|
| - Dart_ActivationFrameGetLocation(frame, &functionName, &function, &location);
|
| + result = Dart_ActivationFrameGetLocation(frame, &functionName, &function, &location);
|
| + ASSERT(!Dart_IsError(result));
|
| +
|
| const String& url = DartUtilities::toString(location.script_url);
|
| intptr_t line = 0;
|
| intptr_t column = 0;
|
| @@ -1302,13 +1310,19 @@ PassRefPtr<Array<CallFrame> > DartInjectedScript::wrapCallFrames(const StackTrac
|
| .setObject(wrapDartHandle(libraries, DartDebuggerObject::Isolate, "backtrace", false))
|
| .release());
|
|
|
| - ret->addItem(CallFrame::create()
|
| + RefPtr<CallFrame> callFrame = CallFrame::create()
|
| .setCallFrameId(getCallFrameId(i, asyncOrdinal))
|
| .setFunctionName(DartUtilities::toString(functionName))
|
| .setLocation(locationJson)
|
| .setScopeChain(scopeChain)
|
| .setThis(thisObject)
|
| - .release());
|
| + .release();
|
| +
|
| + uintptr_t framePointer = 0;
|
| + result = Dart_ActivationFrameGetFramePointer(frame, &framePointer);
|
| + callFrame->setFramePointerHigh(static_cast<double>(framePointer >> 32));
|
| + callFrame->setFramePointerLow(static_cast<double>(framePointer & 0xffffffff));
|
| + ret->addItem(callFrame);
|
| }
|
| return ret;
|
| }
|
|
|