Upstream some scattered Cobalt changes
These changes are found after Cobalt rebased to V8 v8.8. Most changes are grouped into their own CLs and here are the rest. - Replace raw printf with PrintF - Include Starboard as a platform for some implementations - Add some missing headers. This is probably because Cobalt does not compile all of V8 sources so some missing headers are only exposed when compiling Cobalt. Change-Id: Idf1512f57c37c8a63f79b1cf4ffc1da5d08421e2 Bug: v8:10927 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2966197 Auto-Submit: John Xu <johnx@google.com> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: John Xu <johnx@google.com> Cr-Commit-Position: refs/heads/master@{#75376}
This commit is contained in:
parent
e5b8ec490c
commit
5c0bf436eb
@ -1589,16 +1589,16 @@ Object Isolate::ThrowInternal(Object raw_exception, MessageLocation* location) {
|
|||||||
Handle<Object> exception(raw_exception, this);
|
Handle<Object> exception(raw_exception, this);
|
||||||
|
|
||||||
if (FLAG_print_all_exceptions) {
|
if (FLAG_print_all_exceptions) {
|
||||||
printf("=========================================================\n");
|
PrintF("=========================================================\n");
|
||||||
printf("Exception thrown:\n");
|
PrintF("Exception thrown:\n");
|
||||||
if (location) {
|
if (location) {
|
||||||
Handle<Script> script = location->script();
|
Handle<Script> script = location->script();
|
||||||
Handle<Object> name(script->GetNameOrSourceURL(), this);
|
Handle<Object> name(script->GetNameOrSourceURL(), this);
|
||||||
printf("at ");
|
PrintF("at ");
|
||||||
if (name->IsString() && String::cast(*name).length() > 0)
|
if (name->IsString() && String::cast(*name).length() > 0)
|
||||||
String::cast(*name).PrintOn(stdout);
|
String::cast(*name).PrintOn(stdout);
|
||||||
else
|
else
|
||||||
printf("<anonymous>");
|
PrintF("<anonymous>");
|
||||||
// Script::GetLineNumber and Script::GetColumnNumber can allocate on the heap to
|
// Script::GetLineNumber and Script::GetColumnNumber can allocate on the heap to
|
||||||
// initialize the line_ends array, so be careful when calling them.
|
// initialize the line_ends array, so be careful when calling them.
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -1606,7 +1606,7 @@ Object Isolate::ThrowInternal(Object raw_exception, MessageLocation* location) {
|
|||||||
#else
|
#else
|
||||||
if ((false)) {
|
if ((false)) {
|
||||||
#endif
|
#endif
|
||||||
printf(", %d:%d - %d:%d\n",
|
PrintF(", %d:%d - %d:%d\n",
|
||||||
Script::GetLineNumber(script, location->start_pos()) + 1,
|
Script::GetLineNumber(script, location->start_pos()) + 1,
|
||||||
Script::GetColumnNumber(script, location->start_pos()),
|
Script::GetColumnNumber(script, location->start_pos()),
|
||||||
Script::GetLineNumber(script, location->end_pos()) + 1,
|
Script::GetLineNumber(script, location->end_pos()) + 1,
|
||||||
@ -1614,13 +1614,13 @@ Object Isolate::ThrowInternal(Object raw_exception, MessageLocation* location) {
|
|||||||
// Make sure to update the raw exception pointer in case it moved.
|
// Make sure to update the raw exception pointer in case it moved.
|
||||||
raw_exception = *exception;
|
raw_exception = *exception;
|
||||||
} else {
|
} else {
|
||||||
printf(", line %d\n", script->GetLineNumber(location->start_pos()) + 1);
|
PrintF(", line %d\n", script->GetLineNumber(location->start_pos()) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
raw_exception.Print();
|
raw_exception.Print();
|
||||||
printf("Stack Trace:\n");
|
PrintF("Stack Trace:\n");
|
||||||
PrintStack(stdout);
|
PrintStack(stdout);
|
||||||
printf("=========================================================\n");
|
PrintF("=========================================================\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine whether a message needs to be created for the given exception
|
// Determine whether a message needs to be created for the given exception
|
||||||
|
@ -117,7 +117,10 @@ class GeneratedCode {
|
|||||||
#ifdef USE_SIMULATOR
|
#ifdef USE_SIMULATOR
|
||||||
// Defined in simulator-base.h.
|
// Defined in simulator-base.h.
|
||||||
Return Call(Args... args) {
|
Return Call(Args... args) {
|
||||||
#if defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
// Starboard is a platform abstraction interface that also include Windows
|
||||||
|
// platforms like UWP.
|
||||||
|
#if defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN) && \
|
||||||
|
!defined(V8_OS_STARBOARD)
|
||||||
FATAL("Generated code execution not possible during cross-compilation.");
|
FATAL("Generated code execution not possible during cross-compilation.");
|
||||||
#endif // defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
#endif // defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
||||||
return Simulator::current(isolate_)->template Call<Return>(
|
return Simulator::current(isolate_)->template Call<Return>(
|
||||||
@ -127,7 +130,10 @@ class GeneratedCode {
|
|||||||
|
|
||||||
DISABLE_CFI_ICALL Return Call(Args... args) {
|
DISABLE_CFI_ICALL Return Call(Args... args) {
|
||||||
// When running without a simulator we call the entry directly.
|
// When running without a simulator we call the entry directly.
|
||||||
#if defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
// Starboard is a platform abstraction interface that also include Windows
|
||||||
|
// platforms like UWP.
|
||||||
|
#if defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN) && \
|
||||||
|
!defined(V8_OS_STARBOARD)
|
||||||
FATAL("Generated code execution not possible during cross-compilation.");
|
FATAL("Generated code execution not possible during cross-compilation.");
|
||||||
#endif // defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
#endif // defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN)
|
||||||
#if ABI_USES_FUNCTION_DESCRIPTORS
|
#if ABI_USES_FUNCTION_DESCRIPTORS
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#if defined(V8_OS_STARBOARD)
|
||||||
|
#include "starboard/system.h"
|
||||||
|
#define __builtin_abort SbSystemBreakIntoDebugger
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "src/inspector/v8-stack-trace-impl.h"
|
#include "src/inspector/v8-stack-trace-impl.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "src/objects/fixed-array.h"
|
#include "src/objects/fixed-array.h"
|
||||||
#include "src/objects/struct.h"
|
#include "src/objects/struct.h"
|
||||||
|
#include "src/objects/torque-defined-classes.h"
|
||||||
|
|
||||||
// Has to be the last include (doesn't have include guards):
|
// Has to be the last include (doesn't have include guards):
|
||||||
#include "src/objects/object-macros.h"
|
#include "src/objects/object-macros.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "src/regexp/experimental/experimental-bytecode.h"
|
#include "src/regexp/experimental/experimental-bytecode.h"
|
||||||
|
|
||||||
|
#include <cctype>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
|
Loading…
Reference in New Issue
Block a user