mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[gardening] Migrate most files to be implicit-bool-conversion free
Issue https://dart-review.googlesource.com/c/sdk/+/115701 Change-Id: Ib579f0bbc8d694aec74afd837217316a10baf910 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115707 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
parent
698d120328
commit
a64b06ec83
|
@ -798,7 +798,7 @@ Dart_Handle DartUtils::EnvironmentCallback(Dart_Handle name) {
|
|||
// objects. As these will be used by different threads the use of
|
||||
// these depends on the fact that the marking internally in the
|
||||
// Dart_CObject structure is not marking simple value objects.
|
||||
Dart_CObject CObject::api_null_ = {Dart_CObject_kNull, {0}};
|
||||
Dart_CObject CObject::api_null_ = {Dart_CObject_kNull, {false}};
|
||||
Dart_CObject CObject::api_true_ = {Dart_CObject_kBool, {true}};
|
||||
Dart_CObject CObject::api_false_ = {Dart_CObject_kBool, {false}};
|
||||
CObject CObject::null_(&api_null_);
|
||||
|
|
|
@ -233,7 +233,7 @@ class WindowsPathSanitizer {
|
|||
if (len > 2 && path[1] == ':') {
|
||||
*s++ = '/';
|
||||
}
|
||||
for (const char *p = path; *p; ++p, ++s) {
|
||||
for (const char* p = path; *p != '\0'; ++p, ++s) {
|
||||
*s = *p == '\\' ? '/' : *p;
|
||||
}
|
||||
*s = '\0';
|
||||
|
|
|
@ -312,7 +312,7 @@ typedef Coord* (*CoordUnOp)(Coord* coord);
|
|||
// Coordinate.
|
||||
// Used for testing function pointers with structs.
|
||||
DART_EXPORT Coord* CoordinateUnOpTrice(CoordUnOp unop, Coord* coord) {
|
||||
std::cout << "CoordinateUnOpTrice(" << unop << ", " << coord << ")\n";
|
||||
std::cout << "CoordinateUnOpTrice(" << &unop << ", " << coord << ")\n";
|
||||
Coord* retval = unop(unop(unop(coord)));
|
||||
std::cout << "returning " << retval << "\n";
|
||||
return retval;
|
||||
|
@ -327,7 +327,7 @@ typedef intptr_t (*IntptrBinOp)(intptr_t a, intptr_t b);
|
|||
DART_EXPORT IntptrBinOp IntptrAdditionClosure() {
|
||||
std::cout << "IntptrAdditionClosure()\n";
|
||||
IntptrBinOp retval = [](intptr_t a, intptr_t b) { return a + b; };
|
||||
std::cout << "returning " << retval << "\n";
|
||||
std::cout << "returning " << &retval << "\n";
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ DART_EXPORT intptr_t ApplyTo42And74(IntptrBinOp binop) {
|
|||
DART_EXPORT int64_t* NullableInt64ElemAt1(int64_t* a) {
|
||||
std::cout << "NullableInt64ElemAt1(" << a << ")\n";
|
||||
int64_t* retval;
|
||||
if (a) {
|
||||
if (a != nullptr) {
|
||||
std::cout << "not null pointer, address: " << a << "\n";
|
||||
retval = a + 1;
|
||||
} else {
|
||||
|
@ -439,7 +439,7 @@ DART_EXPORT int64_t SumVeryLargeStruct(VeryLargeStruct* vls) {
|
|||
retval += vls->k;
|
||||
retval += vls->smallLastField;
|
||||
std::cout << retval << "\n";
|
||||
if (vls->parent) {
|
||||
if (vls->parent != nullptr) {
|
||||
std::cout << "has parent\n";
|
||||
retval += vls->parent->a;
|
||||
}
|
||||
|
|
|
@ -1507,7 +1507,7 @@ CObject* File::LockRequest(const CObjectArray& request) {
|
|||
// Inspired by sdk/lib/core/uri.dart
|
||||
UriDecoder::UriDecoder(const char* uri) : uri_(uri) {
|
||||
const char* ch = uri;
|
||||
while ((*ch != 0) && (*ch != '%')) {
|
||||
while ((*ch != '\0') && (*ch != '%')) {
|
||||
ch++;
|
||||
}
|
||||
if (*ch == 0) {
|
||||
|
@ -1524,7 +1524,7 @@ UriDecoder::UriDecoder(const char* uri) : uri_(uri) {
|
|||
strncpy(dest, uri, i);
|
||||
decoded_ = dest;
|
||||
dest += i;
|
||||
while (*ch) {
|
||||
while (*ch != '\0') {
|
||||
if (*ch != '%') {
|
||||
*(dest++) = *(ch++);
|
||||
continue;
|
||||
|
|
|
@ -132,7 +132,7 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id, intptr_t path_id) {
|
|||
} else {
|
||||
Dart_ListSetAt(event, 2, Dart_Null());
|
||||
}
|
||||
Dart_ListSetAt(event, 3, Dart_NewBoolean(e->mask & IN_MOVED_TO));
|
||||
Dart_ListSetAt(event, 3, Dart_NewBoolean((e->mask & IN_MOVED_TO) != 0u));
|
||||
Dart_ListSetAt(event, 4, Dart_NewInteger(e->wd));
|
||||
Dart_ListSetAt(events, i, event);
|
||||
i++;
|
||||
|
|
|
@ -41,7 +41,7 @@ TEST_CASE(OpenUri_RelativeFilename) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all characters 'c'
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == 'c') {
|
||||
*t++ = '%';
|
||||
*t++ = '6';
|
||||
|
@ -70,7 +70,7 @@ TEST_CASE(OpenUri_AbsoluteFilename) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all characters 'c'
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == 'c') {
|
||||
*t++ = '%';
|
||||
*t++ = '6';
|
||||
|
@ -110,7 +110,7 @@ TEST_CASE(OpenUri_ValidUri) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all characters 'c'
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == 'c') {
|
||||
*t++ = '%';
|
||||
*t++ = '6';
|
||||
|
@ -151,7 +151,7 @@ TEST_CASE(OpenUri_UriWithSpaces) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all spaces
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == ' ') {
|
||||
*t++ = '%';
|
||||
*t++ = '2';
|
||||
|
@ -180,7 +180,7 @@ TEST_CASE(OpenUri_InvalidUriPercentEncoding) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all characters 'c'
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == 'c') {
|
||||
*t++ = '%';
|
||||
*t++ = 'f';
|
||||
|
@ -200,7 +200,7 @@ TEST_CASE(OpenUri_TruncatedUriPercentEncoding) {
|
|||
strlen(kFilename) * 3 + 1));
|
||||
char* t = encoded;
|
||||
// percent-encode all characters 'c'
|
||||
for (const char* p = kFilename; *p; p++) {
|
||||
for (const char* p = kFilename; *p != '\0'; p++) {
|
||||
if (*p == 'c') {
|
||||
*t++ = '%';
|
||||
*t++ = 'f';
|
||||
|
|
|
@ -909,7 +909,7 @@ int main(int argc, char** argv) {
|
|||
MapFile(load_vm_snapshot_instructions_filename, File::kReadExecute,
|
||||
&init_params.vm_snapshot_instructions);
|
||||
}
|
||||
if (load_isolate_snapshot_data_filename) {
|
||||
if (load_isolate_snapshot_data_filename != nullptr) {
|
||||
mapped_isolate_snapshot_data =
|
||||
MapFile(load_isolate_snapshot_data_filename, File::kReadOnly,
|
||||
&isolate_snapshot_data);
|
||||
|
|
|
@ -619,7 +619,7 @@ Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
|
|||
return result;
|
||||
}
|
||||
if (tag == Dart_kImportExtensionTag) {
|
||||
if (strncmp(url_string, "dart-ext:", 9)) {
|
||||
if (strncmp(url_string, "dart-ext:", 9) != 0) {
|
||||
return DartUtils::NewError(
|
||||
"Native extensions must use the dart-ext: scheme.");
|
||||
}
|
||||
|
|
|
@ -275,7 +275,7 @@ static bool OnIsolateInitialize(void** child_callback_data, char** error) {
|
|||
}
|
||||
} else {
|
||||
result = DartUtils::ResolveScript(Dart_NewStringFromCString(script_uri));
|
||||
if (Dart_IsError(result)) return result;
|
||||
if (Dart_IsError(result)) return result != nullptr;
|
||||
|
||||
if (isolate_group_data->kernel_buffer().get() != nullptr) {
|
||||
// Various core-library parts will send requests to the Loader to resolve
|
||||
|
@ -284,7 +284,7 @@ static bool OnIsolateInitialize(void** child_callback_data, char** error) {
|
|||
// bypasses normal source code loading paths that initialize it.
|
||||
const char* resolved_script_uri = NULL;
|
||||
result = Dart_StringToCString(result, &resolved_script_uri);
|
||||
if (Dart_IsError(result)) return result;
|
||||
if (Dart_IsError(result)) return result != nullptr;
|
||||
Loader::InitForSnapshot(resolved_script_uri, isolate_data);
|
||||
}
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ static Dart_Isolate CreateIsolateGroupAndSetupHelper(
|
|||
}
|
||||
}
|
||||
|
||||
if (flags->copy_parent_code && callback_data) {
|
||||
if (flags->copy_parent_code && callback_data != nullptr) {
|
||||
auto parent_isolate_group_data =
|
||||
reinterpret_cast<IsolateData*>(callback_data)->isolate_group_data();
|
||||
parent_kernel_buffer = parent_isolate_group_data->kernel_buffer();
|
||||
|
|
|
@ -340,7 +340,7 @@ bool Options::ProcessAbiVersionOption(const char* arg,
|
|||
return false;
|
||||
}
|
||||
int ver = 0;
|
||||
for (int i = 0; value[i]; ++i) {
|
||||
for (int i = 0; value[i] != '\0'; ++i) {
|
||||
if (value[i] >= '0' && value[i] <= '9') {
|
||||
ver = (ver * 10) + value[i] - '0';
|
||||
} else {
|
||||
|
|
|
@ -253,7 +253,7 @@ static Dart_Isolate CreateIsolateAndSetup(const char* script_uri,
|
|||
CHECK_RESULT(result);
|
||||
|
||||
// Setup kernel service as the main script for this isolate.
|
||||
if (kernel_service_buffer) {
|
||||
if (kernel_service_buffer != nullptr) {
|
||||
result = Dart_LoadScriptFromKernel(kernel_service_buffer,
|
||||
kernel_service_buffer_size);
|
||||
CHECK_RESULT(result);
|
||||
|
|
|
@ -677,7 +677,7 @@ int SSLFilter::ProcessReadEncryptedBuffer(int start, int end) {
|
|||
bytes_processed =
|
||||
BIO_write(socket_side_, buffers_[kReadEncrypted] + start, length);
|
||||
if (bytes_processed <= 0) {
|
||||
bool retry = BIO_should_retry(socket_side_);
|
||||
bool retry = BIO_should_retry(socket_side_) != 0;
|
||||
if (!retry) {
|
||||
if (SSL_LOG_DATA)
|
||||
Syslog::Print("BIO_write failed in ReadEncryptedBuffer\n");
|
||||
|
|
|
@ -39,7 +39,7 @@ void SecureSocketUtils::FetchErrorString(const SSL* ssl,
|
|||
}
|
||||
if ((path != NULL) && (line >= 0)) {
|
||||
const char* file = strrchr(path, sep[0]);
|
||||
path = file ? file + 1 : path;
|
||||
path = file != nullptr ? file + 1 : path;
|
||||
text_buffer->Printf("(%s:%d)", path, line);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ int SSLCertContext::CertificateCallback(int preverify_ok,
|
|||
filter->callback_error = result;
|
||||
return 0;
|
||||
}
|
||||
return DartUtils::GetBooleanValue(result);
|
||||
return static_cast<int>(DartUtils::GetBooleanValue(result));
|
||||
}
|
||||
|
||||
SSLCertContext* SSLCertContext::GetSecurityContext(Dart_NativeArguments args) {
|
||||
|
|
|
@ -46,7 +46,7 @@ bool SocketBase::FormatNumericAddress(const RawAddr& addr,
|
|||
int len) {
|
||||
socklen_t salen = SocketAddress::GetAddrLength(addr);
|
||||
return (NO_RETRY_EXPECTED(getnameinfo(&addr.addr, salen, address, len, NULL,
|
||||
0, NI_NUMERICHOST) == 0));
|
||||
0, NI_NUMERICHOST) == 0)) != 0;
|
||||
}
|
||||
|
||||
bool SocketBase::IsBindError(intptr_t error_number) {
|
||||
|
|
|
@ -86,7 +86,7 @@ static bool TermHasXTerm() {
|
|||
}
|
||||
|
||||
bool Stdin::AnsiSupported(intptr_t fd, bool* supported) {
|
||||
*supported = isatty(fd) && TermHasXTerm();
|
||||
*supported = (isatty(fd) != 0) && TermHasXTerm();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ bool Stdout::GetTerminalSize(intptr_t fd, int size[2]) {
|
|||
}
|
||||
|
||||
bool Stdout::AnsiSupported(intptr_t fd, bool* supported) {
|
||||
*supported = isatty(fd) && TermHasXTerm();
|
||||
*supported = (isatty(fd) != 0) && TermHasXTerm();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ DEFINE_NATIVE_ENTRY(Developer_debugger, 0, 2) {
|
|||
#if !defined(PRODUCT)
|
||||
GET_NATIVE_ARGUMENT(String, msg, arguments->NativeArgAt(1));
|
||||
Debugger* debugger = isolate->debugger();
|
||||
if (!debugger) {
|
||||
if (debugger == nullptr) {
|
||||
return when.raw();
|
||||
}
|
||||
if (when.value()) {
|
||||
|
|
|
@ -128,7 +128,7 @@ class SpawnIsolateTask : public ThreadPool::Task {
|
|||
}
|
||||
|
||||
~SpawnIsolateTask() override {
|
||||
if (parent_isolate_) {
|
||||
if (parent_isolate_ != nullptr) {
|
||||
parent_isolate_->DecrementSpawnCount();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,20 +253,27 @@ static RawInstance* CreateMethodMirror(const Function& func,
|
|||
args.SetAt(4, Bool::Get(func.is_static()));
|
||||
|
||||
intptr_t kind_flags = 0;
|
||||
kind_flags |= (func.is_abstract() << Mirrors::kAbstract);
|
||||
kind_flags |= (func.IsGetterFunction() << Mirrors::kGetter);
|
||||
kind_flags |= (func.IsSetterFunction() << Mirrors::kSetter);
|
||||
kind_flags |=
|
||||
(static_cast<intptr_t>(func.is_abstract()) << Mirrors::kAbstract);
|
||||
kind_flags |=
|
||||
(static_cast<intptr_t>(func.IsGetterFunction()) << Mirrors::kGetter);
|
||||
kind_flags |=
|
||||
(static_cast<intptr_t>(func.IsSetterFunction()) << Mirrors::kSetter);
|
||||
bool is_ctor = (func.kind() == RawFunction::kConstructor);
|
||||
kind_flags |= (is_ctor << Mirrors::kConstructor);
|
||||
kind_flags |= ((is_ctor && func.is_const()) << Mirrors::kConstCtor);
|
||||
kind_flags |= (static_cast<intptr_t>(is_ctor) << Mirrors::kConstructor);
|
||||
kind_flags |= (static_cast<intptr_t>(is_ctor && func.is_const())
|
||||
<< Mirrors::kConstCtor);
|
||||
kind_flags |=
|
||||
((is_ctor && func.IsGenerativeConstructor()) << Mirrors::kGenerativeCtor);
|
||||
(static_cast<intptr_t>(is_ctor && func.IsGenerativeConstructor())
|
||||
<< Mirrors::kGenerativeCtor);
|
||||
kind_flags |= (static_cast<intptr_t>(is_ctor && func.is_redirecting())
|
||||
<< Mirrors::kRedirectingCtor);
|
||||
kind_flags |= (static_cast<intptr_t>(is_ctor && func.IsFactory())
|
||||
<< Mirrors::kFactoryCtor);
|
||||
kind_flags |=
|
||||
((is_ctor && func.is_redirecting()) << Mirrors::kRedirectingCtor);
|
||||
kind_flags |= ((is_ctor && func.IsFactory()) << Mirrors::kFactoryCtor);
|
||||
kind_flags |= (func.is_external() << Mirrors::kExternal);
|
||||
(static_cast<intptr_t>(func.is_external()) << Mirrors::kExternal);
|
||||
bool is_synthetic = func.is_no_such_method_forwarder();
|
||||
kind_flags |= (is_synthetic << Mirrors::kSynthetic);
|
||||
kind_flags |= (static_cast<intptr_t>(is_synthetic) << Mirrors::kSynthetic);
|
||||
args.SetAt(5, Smi::Handle(Smi::New(kind_flags)));
|
||||
|
||||
return CreateMirror(Symbols::_LocalMethodMirror(), args);
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef RUNTIME_PLATFORM_FLOATING_POINT_H_
|
||||
#define RUNTIME_PLATFORM_FLOATING_POINT_H_
|
||||
|
||||
#include <cmath>
|
||||
|
||||
inline double fmod_ieee(double x, double y) {
|
||||
return fmod(x, y);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_PLATFORM_UTILS_ANDROID_H_
|
||||
#define RUNTIME_PLATFORM_UTILS_ANDROID_H_
|
||||
|
||||
#if !defined(RUNTIME_PLATFORM_UTILS_H_)
|
||||
#error Do not include utils_android.h directly; use utils.h instead.
|
||||
#endif
|
||||
|
||||
#include <endian.h> // NOLINT
|
||||
|
||||
namespace dart {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_PLATFORM_UTILS_LINUX_H_
|
||||
#define RUNTIME_PLATFORM_UTILS_LINUX_H_
|
||||
|
||||
#if !defined(RUNTIME_PLATFORM_UTILS_H_)
|
||||
#error Do not include utils_linux.h directly; use utils.h instead.
|
||||
#endif
|
||||
|
||||
#include <endian.h> // NOLINT
|
||||
|
||||
namespace dart {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_PLATFORM_UTILS_MACOS_H_
|
||||
#define RUNTIME_PLATFORM_UTILS_MACOS_H_
|
||||
|
||||
#if !defined(RUNTIME_PLATFORM_UTILS_H_)
|
||||
#error Do not include utils_macos.h directly; use utils.h instead.
|
||||
#endif
|
||||
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <libkern/OSByteOrder.h> // NOLINT
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_PLATFORM_UTILS_WIN_H_
|
||||
#define RUNTIME_PLATFORM_UTILS_WIN_H_
|
||||
|
||||
#if !defined(RUNTIME_PLATFORM_UTILS_H_)
|
||||
#error Do not include utils_win.h directly; use utils.h instead.
|
||||
#endif
|
||||
|
||||
#include <intrin.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
|
@ -12,17 +12,19 @@ const String clangTidy = './buildtools/linux-x64/clang/bin/clang-tidy';
|
|||
|
||||
List<String> compilerFlagsForFile(String filepath) {
|
||||
final flags = <String>[
|
||||
'-I.',
|
||||
'-Iruntime',
|
||||
'-Ithird_party',
|
||||
'-Iruntime/include',
|
||||
'-Ithird_party/tcmalloc/gperftools/src ',
|
||||
'-Ithird_party/tcmalloc/gperftools/src',
|
||||
'-Ithird_party/boringssl/src/include',
|
||||
'-Ithird_party/zlib',
|
||||
'-DTARGET_ARCH_X64',
|
||||
'-DDEBUG',
|
||||
'-DTARGET_OS_LINUX',
|
||||
'-DTESTING',
|
||||
'-x',
|
||||
'c++',
|
||||
];
|
||||
if (filepath.endsWith("_test.cc")) {
|
||||
flags.add('-DTESTING');
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -35,24 +37,99 @@ Future<ProcessResult> runClangTidyOn(String filepath) async {
|
|||
|
||||
final pool = new Pool(max(1, Platform.numberOfProcessors ~/ 2));
|
||||
|
||||
// TODO(dartbug.com/38196): Ensure all VM sources are clang-tidy clean.
|
||||
final Set<String> migratedFiles = Set<String>.from([
|
||||
'runtime/vm/native_api_impl.cc',
|
||||
'runtime/vm/compiler/backend/constant_propagator.cc',
|
||||
'runtime/vm/compiler/backend/flow_graph.cc',
|
||||
'runtime/vm/compiler/backend/flow_graph_checker.cc',
|
||||
'runtime/vm/compiler/backend/il.cc',
|
||||
'runtime/vm/compiler/backend/inliner.cc',
|
||||
'runtime/vm/compiler/backend/linearscan.cc',
|
||||
'runtime/vm/compiler/backend/loops.cc',
|
||||
'runtime/vm/compiler/backend/loops_test.cc',
|
||||
'runtime/vm/compiler/backend/range_analysis.cc',
|
||||
// Exclude running the linter on those files.
|
||||
final Set<String> excludedFiles = Set<String>.from([
|
||||
// These files are not valid cc files but rather cc templates
|
||||
'runtime/bin/abi_version_in.cc',
|
||||
'runtime/bin/builtin_in.cc',
|
||||
'runtime/bin/snapshot_in.cc',
|
||||
'runtime/lib/libgen_in.cc',
|
||||
'runtime/vm/version_in.cc',
|
||||
|
||||
// These files cannot be analyzed by itself (must be included indirectly).
|
||||
'runtime/bin/android.h',
|
||||
'runtime/bin/eventhandler_android.h',
|
||||
'runtime/bin/eventhandler_fuchsia.h',
|
||||
'runtime/bin/eventhandler_linux.h',
|
||||
'runtime/bin/eventhandler_macos.h',
|
||||
'runtime/bin/eventhandler_win.h',
|
||||
'runtime/bin/namespace_android.h',
|
||||
'runtime/bin/namespace_fuchsia.h',
|
||||
'runtime/bin/namespace_linux.h',
|
||||
'runtime/bin/namespace_macos.h',
|
||||
'runtime/bin/namespace_win.h',
|
||||
'runtime/bin/socket_base_android.h',
|
||||
'runtime/bin/socket_base_fuchsia.h',
|
||||
'runtime/bin/socket_base_linux.h',
|
||||
'runtime/bin/socket_base_macos.h',
|
||||
'runtime/bin/socket_base_win.h',
|
||||
'runtime/bin/thread_android.h',
|
||||
'runtime/bin/thread_fuchsia.h',
|
||||
'runtime/bin/thread_linux.h',
|
||||
'runtime/bin/thread_macos.h',
|
||||
'runtime/bin/thread_win.h',
|
||||
'runtime/platform/atomic_android.h',
|
||||
'runtime/platform/atomic_fuchsia.h',
|
||||
'runtime/platform/atomic_linux.h',
|
||||
'runtime/platform/atomic_macos.h',
|
||||
'runtime/platform/atomic_win.h',
|
||||
'runtime/platform/utils_android.h',
|
||||
'runtime/platform/utils_fuchsia.h',
|
||||
'runtime/platform/utils_linux.h',
|
||||
'runtime/platform/utils_macos.h',
|
||||
'runtime/platform/utils_win.h',
|
||||
'runtime/vm/compiler/assembler/assembler_arm64.h',
|
||||
'runtime/vm/compiler/assembler/assembler_arm.h',
|
||||
'runtime/vm/compiler/assembler/assembler_dbc.h',
|
||||
'runtime/vm/compiler/assembler/assembler_ia32.h',
|
||||
'runtime/vm/compiler/assembler/assembler_x64.h',
|
||||
'runtime/vm/compiler/runtime_offsets_extracted.h',
|
||||
'runtime/vm/constants_arm64.h',
|
||||
'runtime/vm/constants_arm.h',
|
||||
'runtime/vm/constants_dbc.h',
|
||||
'runtime/vm/constants_ia32.h',
|
||||
'runtime/vm/constants_x64.h',
|
||||
'runtime/vm/cpu_arm64.h',
|
||||
'runtime/vm/cpu_arm.h',
|
||||
'runtime/vm/cpu_dbc.h',
|
||||
'runtime/vm/cpu_ia32.h',
|
||||
'runtime/vm/cpu_x64.h',
|
||||
'runtime/vm/instructions_arm64.h',
|
||||
'runtime/vm/instructions_arm.h',
|
||||
'runtime/vm/instructions_dbc.h',
|
||||
'runtime/vm/instructions_ia32.h',
|
||||
'runtime/vm/instructions_x64.h',
|
||||
'runtime/vm/os_thread_android.h',
|
||||
'runtime/vm/os_thread_fuchsia.h',
|
||||
'runtime/vm/os_thread_linux.h',
|
||||
'runtime/vm/os_thread_macos.h',
|
||||
'runtime/vm/os_thread_win.h',
|
||||
'runtime/vm/regexp_assembler_bytecode_inl.h',
|
||||
'runtime/vm/simulator_arm64.h',
|
||||
'runtime/vm/simulator_arm.h',
|
||||
'runtime/vm/simulator_dbc.h',
|
||||
'runtime/vm/stack_frame_arm64.h',
|
||||
'runtime/vm/stack_frame_arm.h',
|
||||
'runtime/vm/stack_frame_dbc.h',
|
||||
'runtime/vm/stack_frame_ia32.h',
|
||||
'runtime/vm/stack_frame_x64.h',
|
||||
|
||||
// By default the gclient checkout doesn't have llvm pulled in.
|
||||
'runtime/llvm_codegen/bit/bit.h',
|
||||
'runtime/llvm_codegen/bit/main.cc',
|
||||
'runtime/llvm_codegen/bit/test.cc',
|
||||
'runtime/llvm_codegen/codegen/main.cc',
|
||||
|
||||
// Only available in special builds
|
||||
'runtime/bin/io_service_no_ssl.h',
|
||||
'runtime/bin/utils_win.h',
|
||||
'runtime/vm/compiler/backend/locations_helpers_arm.h',
|
||||
]);
|
||||
|
||||
main(List<String> files) async {
|
||||
bool isFirstFailure = true;
|
||||
|
||||
files = files.where((filepath) => migratedFiles.contains(filepath)).toList();
|
||||
files = files.where((filepath) => !excludedFiles.contains(filepath)).toList();
|
||||
|
||||
// Analyze the [files] in parallel.
|
||||
await Future.wait(files.map((String filepath) async {
|
||||
|
|
|
@ -5149,7 +5149,7 @@ char* SnapshotHeaderReader::VerifyVersion() {
|
|||
const char* version =
|
||||
reinterpret_cast<const char*>(stream_.AddressOfCurrentPosition());
|
||||
ASSERT(version != NULL);
|
||||
if (strncmp(version, expected_version, version_len)) {
|
||||
if (strncmp(version, expected_version, version_len) != 0) {
|
||||
const intptr_t kMessageBufferSize = 256;
|
||||
char message_buffer[kMessageBufferSize];
|
||||
char* actual_version = Utils::StrNDup(version, version_len);
|
||||
|
@ -5180,7 +5180,7 @@ char* SnapshotHeaderReader::VerifyFeatures(Isolate* isolate) {
|
|||
}
|
||||
|
||||
if (features_length != expected_len ||
|
||||
strncmp(features, expected_features, expected_len)) {
|
||||
(strncmp(features, expected_features, expected_len) != 0)) {
|
||||
const intptr_t kMessageBufferSize = 1024;
|
||||
char message_buffer[kMessageBufferSize];
|
||||
char* actual_features = Utils::StrNDup(
|
||||
|
|
|
@ -500,7 +500,7 @@ void TypeFeedbackSaver::SaveFields() {
|
|||
WriteString(str_);
|
||||
|
||||
WriteInt(field_.guarded_cid());
|
||||
WriteInt(field_.is_nullable());
|
||||
WriteInt(static_cast<intptr_t>(field_.is_nullable()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ RawObject* TypeFeedbackLoader::CheckHeader() {
|
|||
const char* version =
|
||||
reinterpret_cast<const char*>(stream_->AddressOfCurrentPosition());
|
||||
ASSERT(version != NULL);
|
||||
if (strncmp(version, expected_version, version_len)) {
|
||||
if (strncmp(version, expected_version, version_len) != 0) {
|
||||
const intptr_t kMessageBufferSize = 256;
|
||||
char message_buffer[kMessageBufferSize];
|
||||
char* actual_version = Utils::StrNDup(version, version_len);
|
||||
|
@ -695,7 +695,7 @@ RawObject* TypeFeedbackLoader::CheckHeader() {
|
|||
ASSERT(features != NULL);
|
||||
intptr_t buffer_len = Utils::StrNLen(features, stream_->PendingBytes());
|
||||
if ((buffer_len != expected_len) ||
|
||||
strncmp(features, expected_features, expected_len)) {
|
||||
(strncmp(features, expected_features, expected_len) != 0)) {
|
||||
const String& msg = String::Handle(String::NewFormatted(
|
||||
Heap::kOld,
|
||||
"Feedback not compatible with the current VM configuration: "
|
||||
|
@ -783,7 +783,7 @@ RawObject* TypeFeedbackLoader::LoadFields() {
|
|||
field_.set_is_nullable(true);
|
||||
} else {
|
||||
field_.set_guarded_cid(guarded_cid);
|
||||
field_.set_is_nullable(is_nullable || field_.is_nullable());
|
||||
field_.set_is_nullable((is_nullable != 0) || field_.is_nullable());
|
||||
}
|
||||
|
||||
// TODO(rmacnak): Merge other field type feedback.
|
||||
|
|
|
@ -1998,7 +1998,7 @@ void Assembler::Align(int alignment, intptr_t offset) {
|
|||
nop(MAX_NOP_SIZE);
|
||||
bytes_needed -= MAX_NOP_SIZE;
|
||||
}
|
||||
if (bytes_needed) {
|
||||
if (bytes_needed != 0) {
|
||||
nop(bytes_needed);
|
||||
}
|
||||
ASSERT(((offset + buffer_.GetPosition()) & (alignment - 1)) == 0);
|
||||
|
|
|
@ -315,7 +315,7 @@ void KernelBytecodeDisassembler::DecodeInstruction(char* hex_buffer,
|
|||
hex_size - (i * kCharactersPerByte), " %02x", instr[i]);
|
||||
}
|
||||
}
|
||||
if (out_instr_size) {
|
||||
if (out_instr_size != nullptr) {
|
||||
*out_instr_size = instr_size;
|
||||
}
|
||||
|
||||
|
|
|
@ -1767,7 +1767,7 @@ int DisassemblerX64::InstructionDecode(uword pc) {
|
|||
// mov reg8,imm8 or mov reg32,imm32
|
||||
uint8_t opcode = *data;
|
||||
data++;
|
||||
uint8_t is_not_8bit = (opcode >= 0xB8);
|
||||
const bool is_not_8bit = opcode >= 0xB8;
|
||||
int reg = (opcode & 0x7) | (rex_b() ? 8 : 0);
|
||||
if (is_not_8bit) {
|
||||
Print("mov%s %s,", operand_size_code(), NameOfCPURegister(reg));
|
||||
|
@ -1970,7 +1970,7 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
|
|||
remaining_size -= 2;
|
||||
}
|
||||
hex_buffer[hex_index] = '\0';
|
||||
if (out_instr_len) {
|
||||
if (out_instr_len != nullptr) {
|
||||
*out_instr_len = instruction_length;
|
||||
}
|
||||
|
||||
|
|
|
@ -410,7 +410,9 @@ bool FlowGraphDeserializer::ParseBlocks(SExpList* list,
|
|||
CheckSymbol(block_sexp->ExtraLookupValue("block_type"));
|
||||
// Entry block headers are already parsed, but others aren't.
|
||||
if (block_map_.LookupValue(block_id) == nullptr) {
|
||||
if (!ParseBlockHeader(block_sexp, block_id, type_tag)) return false;
|
||||
if (ParseBlockHeader(block_sexp, block_id, type_tag) == nullptr) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (max_block_id_ < block_id) max_block_id_ = block_id;
|
||||
}
|
||||
|
|
|
@ -4802,7 +4802,7 @@ LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone,
|
|||
void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
||||
ASSERT((op_kind() == MethodRecognizer::kMathMin) ||
|
||||
(op_kind() == MethodRecognizer::kMathMax));
|
||||
const intptr_t is_min = (op_kind() == MethodRecognizer::kMathMin);
|
||||
const bool is_min = op_kind() == MethodRecognizer::kMathMin;
|
||||
if (result_cid() == kDoubleCid) {
|
||||
compiler::Label done, returns_nan, are_equal;
|
||||
XmmRegister left = locs()->in(0).fpu_reg();
|
||||
|
|
|
@ -572,7 +572,7 @@ class RegisterSet : public ValueObject {
|
|||
|
||||
void AddAllNonReservedRegisters(bool include_fpu_registers) {
|
||||
for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
|
||||
if (kReservedCpuRegisters & (1 << i)) continue;
|
||||
if ((kReservedCpuRegisters & (1 << i)) != 0u) continue;
|
||||
Add(Location::RegisterLocation(static_cast<Register>(i)));
|
||||
}
|
||||
|
||||
|
|
|
@ -876,9 +876,9 @@ const char* LoopInfo::ToCString() const {
|
|||
num_blocks++;
|
||||
}
|
||||
f.Print("#blocks=%" Pd, num_blocks);
|
||||
if (outer_) f.Print(" outer=%" Pd, outer_->id_);
|
||||
if (inner_) f.Print(" inner=%" Pd, inner_->id_);
|
||||
if (next_) f.Print(" next=%" Pd, next_->id_);
|
||||
if (outer_ != nullptr) f.Print(" outer=%" Pd, outer_->id_);
|
||||
if (inner_ != nullptr) f.Print(" inner=%" Pd, inner_->id_);
|
||||
if (next_ != nullptr) f.Print(" next=%" Pd, next_->id_);
|
||||
f.Print(" [");
|
||||
for (intptr_t i = 0, n = back_edges_.length(); i < n; i++) {
|
||||
f.Print(" B%" Pd, back_edges_[i]->block_id());
|
||||
|
|
|
@ -122,7 +122,7 @@ static intptr_t HandleLineBreaking(Zone* zone,
|
|||
const intptr_t leading_length = leading_space ? 1 : 0;
|
||||
|
||||
if ((leading_length + single_line_width) < remaining) {
|
||||
if (leading_space != 0) buffer->AddChar(' ');
|
||||
if (leading_space) buffer->AddChar(' ');
|
||||
buffer->AddString(line_buffer->buf());
|
||||
line_buffer->Clear();
|
||||
return remaining - (leading_length + single_line_width);
|
||||
|
@ -508,7 +508,7 @@ SExpression* SExpParser::TokenToSExpression(Token* token) {
|
|||
SExpParser::Token* SExpParser::GetNextToken() {
|
||||
intptr_t start_pos = cur_pos_;
|
||||
while (start_pos < buffer_size_) {
|
||||
if (!isspace(buffer_[start_pos])) break;
|
||||
if (isspace(buffer_[start_pos]) == 0) break;
|
||||
start_pos++;
|
||||
}
|
||||
if (start_pos >= buffer_size_) return nullptr;
|
||||
|
@ -582,7 +582,7 @@ SExpParser::Token* SExpParser::GetNextToken() {
|
|||
}
|
||||
// If we find a character that can't appear in a number, then fall back
|
||||
// to symbol-ness.
|
||||
if (!isdigit(start[len])) type = kSymbol;
|
||||
if (isdigit(start[len]) == 0) type = kSymbol;
|
||||
len++;
|
||||
}
|
||||
cur_pos_ = start_pos + len;
|
||||
|
@ -615,7 +615,7 @@ SExpParser::Token* SExpParser::GetNextToken() {
|
|||
}
|
||||
|
||||
bool SExpParser::IsSymbolContinue(char c) {
|
||||
return !isspace(c) && c != '(' && c != ')' && c != ',' && c != '{' &&
|
||||
return (isspace(c) == 0) && c != '(' && c != ')' && c != ',' && c != '{' &&
|
||||
c != '}' && c != '"';
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class Slot : public ZoneAllocated {
|
|||
bool is_immutable() const { return IsImmutableBit::decode(flags_); }
|
||||
|
||||
intptr_t nullable_cid() const { return cid_; }
|
||||
intptr_t is_nullable() const { return IsNullableBit::decode(flags_); }
|
||||
bool is_nullable() const { return IsNullableBit::decode(flags_); }
|
||||
|
||||
// Returns true if properties of this slot were based on the guarded state
|
||||
// of the corresponding Dart field.
|
||||
|
|
|
@ -1107,7 +1107,7 @@ RawBool* CallSpecializer::InstanceOfAsBool(
|
|||
: Class::IsSubtypeOf(cls, Object::null_type_arguments(), type_class,
|
||||
Object::null_type_arguments(), Heap::kOld);
|
||||
results->Add(cls.id());
|
||||
results->Add(is_subtype);
|
||||
results->Add(static_cast<intptr_t>(is_subtype));
|
||||
if (prev.IsNull()) {
|
||||
prev = Bool::Get(is_subtype).raw();
|
||||
} else {
|
||||
|
@ -1391,7 +1391,7 @@ static void TryAddTest(ZoneGrowableArray<intptr_t>* results,
|
|||
bool result) {
|
||||
if (!CidTestResultsContains(*results, test_cid)) {
|
||||
results->Add(test_cid);
|
||||
results->Add(result);
|
||||
results->Add(static_cast<intptr_t>(result));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1427,7 +1427,7 @@ bool CallSpecializer::SpecializeTestCidsForNumericTypes(
|
|||
(*results)[i] = (*results)[i - 2];
|
||||
}
|
||||
(*results)[0] = kSmiCid;
|
||||
(*results)[1] = smi_is_subtype;
|
||||
(*results)[1] = static_cast<intptr_t>(smi_is_subtype);
|
||||
}
|
||||
|
||||
ASSERT(type.IsInstantiated());
|
||||
|
|
|
@ -2007,9 +2007,9 @@ void BytecodeFlowGraphBuilder::CollectControlFlow(
|
|||
Array::ZoneHandle(Z, handlers.GetHandledTypes(try_index));
|
||||
|
||||
CatchBlockEntryInstr* entry = new (Z) CatchBlockEntryInstr(
|
||||
TokenPosition::kNoSource, handler_info.is_generated,
|
||||
TokenPosition::kNoSource, handler_info.is_generated != 0,
|
||||
B->AllocateBlockId(), handler_info.outer_try_index, graph_entry,
|
||||
handler_types, try_index, handler_info.needs_stacktrace,
|
||||
handler_types, try_index, handler_info.needs_stacktrace != 0,
|
||||
B->GetNextDeoptId(), nullptr, nullptr, exception_var_, stacktrace_var_);
|
||||
graph_entry->AddCatchEntry(entry);
|
||||
|
||||
|
|
|
@ -167,10 +167,10 @@ bool BytecodeMetadataHelper::FindModifiedLibrariesForHotReload(
|
|||
*is_empty_program = (bytecode_component.GetNumLibraries() == 0);
|
||||
}
|
||||
if (p_num_classes != nullptr) {
|
||||
*p_num_classes = (bytecode_component.GetNumClasses() == 0);
|
||||
*p_num_classes = bytecode_component.GetNumClasses();
|
||||
}
|
||||
if (p_num_procedures != nullptr) {
|
||||
*p_num_procedures = (bytecode_component.GetNumCodes() == 0);
|
||||
*p_num_procedures = bytecode_component.GetNumCodes();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -645,7 +645,7 @@ void KernelFingerprintHelper::CalculateStatementFingerprint() {
|
|||
ReadPosition(); // read jth position.
|
||||
CalculateExpressionFingerprint(); // read jth expression.
|
||||
}
|
||||
BuildHash(ReadBool()); // read is_default.
|
||||
BuildHash(static_cast<uint32_t>(ReadBool())); // read is_default.
|
||||
CalculateStatementFingerprint(); // read body.
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -689,12 +689,12 @@ class ClassHelper {
|
|||
void SetNext(Field field) { next_read_ = field; }
|
||||
void SetJustRead(Field field) { next_read_ = field + 1; }
|
||||
|
||||
bool is_abstract() const { return flags_ & Flag::kIsAbstract; }
|
||||
bool is_abstract() const { return (flags_ & Flag::kIsAbstract) != 0; }
|
||||
|
||||
bool is_enum_class() const { return flags_ & Flag::kIsEnumClass; }
|
||||
bool is_enum_class() const { return (flags_ & Flag::kIsEnumClass) != 0; }
|
||||
|
||||
bool is_transformed_mixin_application() const {
|
||||
return flags_ & Flag::kIsEliminatedMixin;
|
||||
return (flags_ & Flag::kIsEliminatedMixin) != 0;
|
||||
}
|
||||
|
||||
NameIndex canonical_name_;
|
||||
|
|
|
@ -357,7 +357,7 @@ uword Class::GetInstanceSize(const dart::Class& handle) {
|
|||
}
|
||||
|
||||
intptr_t Class::NumTypeArguments(const dart::Class& klass) {
|
||||
return klass.NumTypeArguments() > 0;
|
||||
return klass.NumTypeArguments();
|
||||
}
|
||||
|
||||
bool Class::HasTypeArgumentsField(const dart::Class& klass) {
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_CPU_ARM_H_
|
||||
#define RUNTIME_VM_CPU_ARM_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_CPU_H_)
|
||||
#error Do not include cpu_arm.h directly; use cpu.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/simulator.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_CPU_ARM64_H_
|
||||
#define RUNTIME_VM_CPU_ARM64_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_CPU_H_)
|
||||
#error Do not include cpu_arm64.h directly; use cpu.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/simulator.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_CPU_DBC_H_
|
||||
#define RUNTIME_VM_CPU_DBC_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_CPU_H_)
|
||||
#error Do not include cpu_dbc.h directly; use cpu.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/simulator.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_CPU_IA32_H_
|
||||
#define RUNTIME_VM_CPU_IA32_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_CPU_H_)
|
||||
#error Do not include cpu_ia32.h directly; use cpu.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/flags.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_CPU_X64_H_
|
||||
#define RUNTIME_VM_CPU_X64_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_CPU_H_)
|
||||
#error Do not include cpu_x64.h directly; use cpu.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/allocation.h"
|
||||
#include "vm/flags.h"
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ static void native_echo(Dart_NativeArguments args) {
|
|||
EXPECT_VALID(toString);
|
||||
const char* c_str = NULL;
|
||||
EXPECT_VALID(Dart_StringToCString(toString, &c_str));
|
||||
if (saved_echo) {
|
||||
if (saved_echo != nullptr) {
|
||||
free(saved_echo);
|
||||
}
|
||||
saved_echo = strdup(c_str);
|
||||
|
@ -333,7 +333,7 @@ VM_UNIT_TEST_CASE(CustomIsolates) {
|
|||
|
||||
OS::PrintErr("-- Starting event loop --\n");
|
||||
Event* event = event_queue->Get();
|
||||
while (event) {
|
||||
while (event != nullptr) {
|
||||
event->Process();
|
||||
delete event;
|
||||
event = event_queue->Get();
|
||||
|
|
|
@ -6479,7 +6479,7 @@ Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer,
|
|||
BackgroundCompiler::Stop(I);
|
||||
DropRegExpMatchCode(Z);
|
||||
|
||||
if (reused_instructions) {
|
||||
if (reused_instructions != nullptr) {
|
||||
DropCodeWithoutReusableInstructions(reused_instructions);
|
||||
}
|
||||
ProgramVisitor::Dedup();
|
||||
|
@ -6506,7 +6506,7 @@ Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer,
|
|||
*isolate_snapshot_instructions_size =
|
||||
isolate_image_writer.InstructionsBlobSize();
|
||||
|
||||
if (reused_instructions) {
|
||||
if (reused_instructions != nullptr) {
|
||||
*isolate_snapshot_instructions_buffer = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -4509,9 +4509,9 @@ static Dart_NativeFunction TestNativeFieldsAccess_lookup(Dart_Handle name,
|
|||
}
|
||||
const char* function_name = obj.ToCString();
|
||||
ASSERT(function_name != NULL);
|
||||
if (!strcmp(function_name, "TestNativeFieldsAccess_init")) {
|
||||
if (strcmp(function_name, "TestNativeFieldsAccess_init") == 0) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(&TestNativeFieldsAccess_init);
|
||||
} else if (!strcmp(function_name, "TestNativeFieldsAccess_access")) {
|
||||
} else if (strcmp(function_name, "TestNativeFieldsAccess_access") == 0) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(
|
||||
&TestNativeFieldsAccess_access);
|
||||
} else {
|
||||
|
@ -5754,9 +5754,9 @@ static Dart_NativeFunction native_args_lookup(Dart_Handle name,
|
|||
*auto_scope_setup = true;
|
||||
const char* function_name = obj.ToCString();
|
||||
ASSERT(function_name != NULL);
|
||||
if (!strcmp(function_name, "NativeArgument_Create")) {
|
||||
if (strcmp(function_name, "NativeArgument_Create") == 0) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(&NativeArgumentCreate);
|
||||
} else if (!strcmp(function_name, "NativeArgument_Access")) {
|
||||
} else if (strcmp(function_name, "NativeArgument_Access") == 0) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(&NativeArgumentAccess);
|
||||
}
|
||||
return NULL;
|
||||
|
@ -6958,13 +6958,13 @@ static Dart_NativeFunction MyNativeClosureResolver(Dart_Handle name,
|
|||
const char* kNativeFoo2 = "NativeFoo2";
|
||||
const char* kNativeFoo3 = "NativeFoo3";
|
||||
const char* kNativeFoo4 = "NativeFoo4";
|
||||
if (!strncmp(function_name, kNativeFoo1, strlen(kNativeFoo1))) {
|
||||
if (strncmp(function_name, kNativeFoo1, strlen(kNativeFoo1)) == 0) {
|
||||
return &NativeFoo1;
|
||||
} else if (!strncmp(function_name, kNativeFoo2, strlen(kNativeFoo2))) {
|
||||
} else if (strncmp(function_name, kNativeFoo2, strlen(kNativeFoo2)) == 0) {
|
||||
return &NativeFoo2;
|
||||
} else if (!strncmp(function_name, kNativeFoo3, strlen(kNativeFoo3))) {
|
||||
} else if (strncmp(function_name, kNativeFoo3, strlen(kNativeFoo3)) == 0) {
|
||||
return &NativeFoo3;
|
||||
} else if (!strncmp(function_name, kNativeFoo4, strlen(kNativeFoo4))) {
|
||||
} else if (strncmp(function_name, kNativeFoo4, strlen(kNativeFoo4)) == 0) {
|
||||
return &NativeFoo4;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
|
@ -7098,13 +7098,13 @@ static Dart_NativeFunction MyStaticNativeClosureResolver(
|
|||
const char* kNativeFoo2 = "StaticNativeFoo2";
|
||||
const char* kNativeFoo3 = "StaticNativeFoo3";
|
||||
const char* kNativeFoo4 = "StaticNativeFoo4";
|
||||
if (!strncmp(function_name, kNativeFoo1, strlen(kNativeFoo1))) {
|
||||
if (strncmp(function_name, kNativeFoo1, strlen(kNativeFoo1)) == 0) {
|
||||
return &StaticNativeFoo1;
|
||||
} else if (!strncmp(function_name, kNativeFoo2, strlen(kNativeFoo2))) {
|
||||
} else if (strncmp(function_name, kNativeFoo2, strlen(kNativeFoo2)) == 0) {
|
||||
return &StaticNativeFoo2;
|
||||
} else if (!strncmp(function_name, kNativeFoo3, strlen(kNativeFoo3))) {
|
||||
} else if (strncmp(function_name, kNativeFoo3, strlen(kNativeFoo3)) == 0) {
|
||||
return &StaticNativeFoo3;
|
||||
} else if (!strncmp(function_name, kNativeFoo4, strlen(kNativeFoo4))) {
|
||||
} else if (strncmp(function_name, kNativeFoo4, strlen(kNativeFoo4)) == 0) {
|
||||
return &StaticNativeFoo4;
|
||||
} else {
|
||||
UNREACHABLE();
|
||||
|
|
|
@ -1945,7 +1945,7 @@ bool Debugger::SetupStepOverAsyncSuspension(const char** error) {
|
|||
ActivationFrame* top_frame = TopDartFrame();
|
||||
if (!IsAtAsyncJump(top_frame)) {
|
||||
// Not at an async operation.
|
||||
if (error) {
|
||||
if (error != nullptr) {
|
||||
*error = "Isolate must be paused at an async suspension point";
|
||||
}
|
||||
return false;
|
||||
|
@ -1957,7 +1957,7 @@ bool Debugger::SetupStepOverAsyncSuspension(const char** error) {
|
|||
Breakpoint* bpt = SetBreakpointAtActivation(Instance::Cast(closure), true);
|
||||
if (bpt == NULL) {
|
||||
// Unable to set the breakpoint.
|
||||
if (error) {
|
||||
if (error != nullptr) {
|
||||
*error = "Unable to set breakpoint at async suspension point";
|
||||
}
|
||||
return false;
|
||||
|
@ -1968,7 +1968,7 @@ bool Debugger::SetupStepOverAsyncSuspension(const char** error) {
|
|||
bool Debugger::SetResumeAction(ResumeAction action,
|
||||
intptr_t frame_index,
|
||||
const char** error) {
|
||||
if (error) {
|
||||
if (error != nullptr) {
|
||||
*error = NULL;
|
||||
}
|
||||
resume_frame_index_ = -1;
|
||||
|
@ -4051,7 +4051,7 @@ bool Debugger::CanRewindFrame(intptr_t frame_index, const char** error) const {
|
|||
DebuggerStackTrace* stack = Isolate::Current()->debugger()->StackTrace();
|
||||
intptr_t num_frames = stack->Length();
|
||||
if (frame_index < 1 || frame_index >= num_frames) {
|
||||
if (error) {
|
||||
if (error != nullptr) {
|
||||
*error = Thread::Current()->zone()->PrintToString(
|
||||
"Frame must be in bounds [1..%" Pd
|
||||
"]: "
|
||||
|
|
|
@ -256,7 +256,7 @@ class SymbolTable : public Section {
|
|||
|
||||
static uint32_t ElfHash(const unsigned char* name) {
|
||||
uint32_t h = 0;
|
||||
while (*name) {
|
||||
while (*name != '\0') {
|
||||
h = (h << 4) + *name++;
|
||||
uint32_t g = h & 0xf0000000;
|
||||
h ^= g;
|
||||
|
|
|
@ -76,7 +76,7 @@ static Dart_NativeFunction native_lookup(Dart_Handle name,
|
|||
int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries);
|
||||
for (int i = 0; i < num_entries; i++) {
|
||||
struct NativeEntries* entry = &(BuiltinEntries[i]);
|
||||
if (!strcmp(function_name, entry->name_) &&
|
||||
if ((strcmp(function_name, entry->name_) == 0) &&
|
||||
(argument_count == entry->argument_count_)) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(entry->function_);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#ifndef RUNTIME_VM_FRAME_LAYOUT_H_
|
||||
#define RUNTIME_VM_FRAME_LAYOUT_H_
|
||||
|
||||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
|
||||
// FrameLayout structure captures configuration specific properties of the
|
||||
// frame layout used by the runtime system and compiler.
|
||||
//
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef RUNTIME_VM_HASH_H_
|
||||
#define RUNTIME_VM_HASH_H_
|
||||
|
||||
#include "platform/globals.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
inline uint32_t CombineHashes(uint32_t hash, uint32_t other_hash) {
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace dart {
|
|||
|
||||
static uword Allocate(FreeList* free_list, intptr_t size, bool is_protected) {
|
||||
uword result = free_list->TryAllocate(size, is_protected);
|
||||
if (result && is_protected) {
|
||||
if ((result != 0u) && is_protected) {
|
||||
VirtualMemory::Protect(reinterpret_cast<void*>(result), size,
|
||||
VirtualMemory::kReadExecute);
|
||||
}
|
||||
|
|
|
@ -585,7 +585,7 @@ void Heap::CheckStartConcurrentMarking(Thread* thread, GCReason reason) {
|
|||
if (old_space_.AlmostNeedsGarbageCollection()) {
|
||||
if (BeginOldSpaceGC(thread)) {
|
||||
TIMELINE_FUNCTION_GC_DURATION_BASIC(thread, "StartConcurrentMarking");
|
||||
old_space_.CollectGarbage(kMarkSweep, false /* finish */);
|
||||
old_space_.CollectGarbage(/*compact=*/false, /*finalize=*/false);
|
||||
EndOldSpaceGC();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef RUNTIME_VM_HEAP_SPACES_H_
|
||||
#define RUNTIME_VM_HEAP_SPACES_H_
|
||||
|
||||
#include "platform/globals.h"
|
||||
|
||||
// This file contains utilities shared by old and new space.
|
||||
// TODO(koda): Create Space base class with Space::CurrentUsage().
|
||||
|
||||
|
|
|
@ -2595,7 +2595,7 @@ SwitchDispatch:
|
|||
{
|
||||
BYTECODE(AssertBoolean, A);
|
||||
RawObject* value = SP[0];
|
||||
if (rA) { // Should we perform type check?
|
||||
if (rA != 0u) { // Should we perform type check?
|
||||
if ((value == true_value) || (value == false_value)) {
|
||||
goto AssertBooleanOk;
|
||||
}
|
||||
|
|
|
@ -676,7 +676,7 @@ void IsolateMessageHandler::MessageNotify(Message::Priority priority) {
|
|||
I->ScheduleInterrupts(Thread::kMessageInterrupt);
|
||||
}
|
||||
Dart_MessageNotifyCallback callback = I->message_notify_callback();
|
||||
if (callback) {
|
||||
if (callback != nullptr) {
|
||||
// Allow the embedder to handle message notification.
|
||||
(*callback)(Api::CastIsolate(I));
|
||||
}
|
||||
|
@ -2819,7 +2819,7 @@ void Isolate::VisitIsolates(IsolateVisitor* visitor) {
|
|||
// SafepointMonitorLocker to ensure the lock has safepoint checks.
|
||||
SafepointMonitorLocker ml(isolates_list_monitor_);
|
||||
Isolate* current = isolates_list_head_;
|
||||
while (current) {
|
||||
while (current != nullptr) {
|
||||
visitor->VisitIsolate(current);
|
||||
current = current->next_;
|
||||
}
|
||||
|
@ -2887,7 +2887,7 @@ void Isolate::RemoveIsolateFromList(Isolate* isolate) {
|
|||
}
|
||||
Isolate* previous = nullptr;
|
||||
Isolate* current = isolates_list_head_;
|
||||
while (current) {
|
||||
while (current != nullptr) {
|
||||
if (current == isolate) {
|
||||
ASSERT(previous != nullptr);
|
||||
previous->next_ = current->next_;
|
||||
|
|
|
@ -83,7 +83,7 @@ void InstanceMorpher::AddObject(RawObject* object) const {
|
|||
}
|
||||
|
||||
void InstanceMorpher::ComputeMapping() {
|
||||
if (from_.NumTypeArguments()) {
|
||||
if (from_.NumTypeArguments() > 0) {
|
||||
// Add copying of the optional type argument field.
|
||||
intptr_t from_offset = from_.type_arguments_field_offset();
|
||||
ASSERT(from_offset != Class::kNoTypeArguments);
|
||||
|
@ -217,7 +217,7 @@ void InstanceMorpher::CreateMorphedCopies() const {
|
|||
|
||||
void InstanceMorpher::DumpFormatFor(const Class& cls) const {
|
||||
THR_Print("%s\n", cls.ToCString());
|
||||
if (cls.NumTypeArguments()) {
|
||||
if (cls.NumTypeArguments() > 0) {
|
||||
intptr_t field_offset = cls.type_arguments_field_offset();
|
||||
ASSERT(field_offset != Class::kNoTypeArguments);
|
||||
THR_Print(" - @%" Pd " <type arguments>\n", field_offset);
|
||||
|
|
|
@ -270,7 +270,7 @@ void JSONStream::PostReply() {
|
|||
|
||||
const char* JSONStream::LookupParam(const char* key) const {
|
||||
for (int i = 0; i < num_params(); i++) {
|
||||
if (!strcmp(key, param_keys_[i])) {
|
||||
if (strcmp(key, param_keys_[i]) == 0) {
|
||||
return param_values_[i];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1316,7 +1316,7 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library,
|
|||
for (intptr_t n = 0; n < name_count; ++n) {
|
||||
String& show_hide_name =
|
||||
H.DartSymbolObfuscate(helper_.ReadStringReference());
|
||||
if (flags & LibraryDependencyHelper::Show) {
|
||||
if ((flags & LibraryDependencyHelper::Show) != 0) {
|
||||
show_list.Add(show_hide_name, Heap::kOld);
|
||||
} else {
|
||||
hide_list.Add(show_hide_name, Heap::kOld);
|
||||
|
@ -1351,7 +1351,7 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library,
|
|||
}
|
||||
String& prefix = H.DartSymbolPlain(dependency_helper.name_index_);
|
||||
ns = Namespace::New(target_library, show_names, hide_names);
|
||||
if (dependency_helper.flags_ & LibraryDependencyHelper::Export) {
|
||||
if ((dependency_helper.flags_ & LibraryDependencyHelper::Export) != 0) {
|
||||
library->AddExport(ns);
|
||||
} else {
|
||||
if (prefix.IsNull() || prefix.Length() == 0) {
|
||||
|
@ -1363,7 +1363,8 @@ void KernelLoader::LoadLibraryImportsAndExports(Library* library,
|
|||
} else {
|
||||
library_prefix = LibraryPrefix::New(
|
||||
prefix, ns,
|
||||
dependency_helper.flags_ & LibraryDependencyHelper::Deferred,
|
||||
(dependency_helper.flags_ & LibraryDependencyHelper::Deferred) !=
|
||||
0,
|
||||
*library);
|
||||
library->AddObject(library_prefix, prefix);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ void MessageHandler::PostMessage(std::unique_ptr<Message> message,
|
|||
MonitorLocker ml(&monitor_);
|
||||
if (FLAG_trace_isolates) {
|
||||
Isolate* source_isolate = Isolate::Current();
|
||||
if (source_isolate) {
|
||||
if (source_isolate != nullptr) {
|
||||
OS::PrintErr(
|
||||
"[>] Posting message:\n"
|
||||
"\tlen: %" Pd "\n\tsource: (%" Pd64
|
||||
|
@ -416,7 +416,7 @@ void MessageHandler::TaskCallback() {
|
|||
#endif // !defined(PRODUCT)
|
||||
|
||||
if (status == kOK) {
|
||||
if (start_callback_) {
|
||||
if (start_callback_ != nullptr) {
|
||||
// Initialize the message handler by running its start function,
|
||||
// if we have one. For an isolate, this will run the isolate's
|
||||
// main() function.
|
||||
|
|
|
@ -120,7 +120,8 @@ class NativeArguments {
|
|||
if ((function_bits & (kClosureFunctionBit | kInstanceFunctionBit)) ==
|
||||
(kClosureFunctionBit | kInstanceFunctionBit)) {
|
||||
// Retrieve the receiver from the context.
|
||||
const int closure_index = (function_bits & kGenericFunctionBit) ? 1 : 0;
|
||||
const int closure_index =
|
||||
(function_bits & kGenericFunctionBit) != 0 ? 1 : 0;
|
||||
const Object& closure = Object::Handle(ArgAt(closure_index));
|
||||
const Context& context =
|
||||
Context::Handle(Closure::Cast(closure).context());
|
||||
|
@ -268,17 +269,17 @@ class NativeArguments {
|
|||
|
||||
// Returns true if the arguments are those of an instance function call.
|
||||
bool ToInstanceFunction() const {
|
||||
return (FunctionBits::decode(argc_tag_) & kInstanceFunctionBit);
|
||||
return (FunctionBits::decode(argc_tag_) & kInstanceFunctionBit) != 0;
|
||||
}
|
||||
|
||||
// Returns true if the arguments are those of a closure function call.
|
||||
bool ToClosureFunction() const {
|
||||
return (FunctionBits::decode(argc_tag_) & kClosureFunctionBit);
|
||||
return (FunctionBits::decode(argc_tag_) & kClosureFunctionBit) != 0;
|
||||
}
|
||||
|
||||
// Returns true if the arguments are those of a generic function call.
|
||||
bool ToGenericFunction() const {
|
||||
return (FunctionBits::decode(argc_tag_) & kGenericFunctionBit);
|
||||
return (FunctionBits::decode(argc_tag_) & kGenericFunctionBit) != 0;
|
||||
}
|
||||
|
||||
int NumHiddenArgs(int function_bits) const {
|
||||
|
|
|
@ -2986,7 +2986,7 @@ RawFunction* Function::CreateMethodExtractor(const String& getter_name) const {
|
|||
// Initialize signature: receiver is a single fixed parameter.
|
||||
const intptr_t kNumParameters = 1;
|
||||
extractor.set_num_fixed_parameters(kNumParameters);
|
||||
extractor.SetNumOptionalParameters(0, 0);
|
||||
extractor.SetNumOptionalParameters(0, false);
|
||||
extractor.set_parameter_types(Object::extractor_parameter_types());
|
||||
extractor.set_parameter_names(Object::extractor_parameter_names());
|
||||
extractor.set_result_type(Object::dynamic_type());
|
||||
|
@ -12938,7 +12938,7 @@ bool StackMap::GetBit(intptr_t bit_index) const {
|
|||
int bit_remainder = bit_index & (kBitsPerByte - 1);
|
||||
uint8_t byte_mask = 1U << bit_remainder;
|
||||
uint8_t byte = raw_ptr()->data()[byte_index];
|
||||
return (byte & byte_mask);
|
||||
return (byte & byte_mask) != 0;
|
||||
}
|
||||
|
||||
void StackMap::SetBit(intptr_t bit_index, bool value) const {
|
||||
|
@ -13202,9 +13202,9 @@ void ExceptionHandlers::SetHandlerInfo(intptr_t try_index,
|
|||
ASSERT((handler_pc_offset == static_cast<uword>(kMaxUint32)) ||
|
||||
(handler_pc_offset < static_cast<uword>(kMaxUint32)));
|
||||
info->handler_pc_offset = handler_pc_offset;
|
||||
info->needs_stacktrace = needs_stacktrace;
|
||||
info->has_catch_all = has_catch_all;
|
||||
info->is_generated = is_generated;
|
||||
info->needs_stacktrace = static_cast<int8_t>(needs_stacktrace);
|
||||
info->has_catch_all = static_cast<int8_t>(has_catch_all);
|
||||
info->is_generated = static_cast<int8_t>(is_generated);
|
||||
}
|
||||
|
||||
void ExceptionHandlers::GetHandlerInfo(intptr_t try_index,
|
||||
|
@ -13226,17 +13226,17 @@ intptr_t ExceptionHandlers::OuterTryIndex(intptr_t try_index) const {
|
|||
|
||||
bool ExceptionHandlers::NeedsStackTrace(intptr_t try_index) const {
|
||||
ASSERT((try_index >= 0) && (try_index < num_entries()));
|
||||
return raw_ptr()->data()[try_index].needs_stacktrace;
|
||||
return raw_ptr()->data()[try_index].needs_stacktrace != 0;
|
||||
}
|
||||
|
||||
bool ExceptionHandlers::IsGenerated(intptr_t try_index) const {
|
||||
ASSERT((try_index >= 0) && (try_index < num_entries()));
|
||||
return raw_ptr()->data()[try_index].is_generated;
|
||||
return raw_ptr()->data()[try_index].is_generated != 0;
|
||||
}
|
||||
|
||||
bool ExceptionHandlers::HasCatchAll(intptr_t try_index) const {
|
||||
ASSERT((try_index >= 0) && (try_index < num_entries()));
|
||||
return raw_ptr()->data()[try_index].has_catch_all;
|
||||
return raw_ptr()->data()[try_index].has_catch_all != 0;
|
||||
}
|
||||
|
||||
void ExceptionHandlers::SetHandledTypes(intptr_t try_index,
|
||||
|
@ -13323,7 +13323,7 @@ const char* ExceptionHandlers::ToCString() const {
|
|||
handled_types.IsNull() ? 0 : handled_types.Length();
|
||||
len += Utils::SNPrint(NULL, 0, FORMAT1, i, info.handler_pc_offset,
|
||||
num_types, info.outer_try_index,
|
||||
info.is_generated ? "(generated)" : "");
|
||||
info.is_generated != 0 ? "(generated)" : "");
|
||||
for (int k = 0; k < num_types; k++) {
|
||||
type ^= handled_types.At(k);
|
||||
ASSERT(!type.IsNull());
|
||||
|
@ -13342,7 +13342,7 @@ const char* ExceptionHandlers::ToCString() const {
|
|||
num_chars +=
|
||||
Utils::SNPrint((buffer + num_chars), (len - num_chars), FORMAT1, i,
|
||||
info.handler_pc_offset, num_types, info.outer_try_index,
|
||||
info.is_generated ? "(generated)" : "");
|
||||
info.is_generated != 0 ? "(generated)" : "");
|
||||
for (int k = 0; k < num_types; k++) {
|
||||
type ^= handled_types.At(k);
|
||||
num_chars += Utils::SNPrint((buffer + num_chars), (len - num_chars),
|
||||
|
|
|
@ -671,7 +671,8 @@ class Pass2Visitor : public ObjectVisitor,
|
|||
writer_->WriteUnsigned(kNullData);
|
||||
} else if (cid == kBoolCid) {
|
||||
writer_->WriteUnsigned(kBoolData);
|
||||
writer_->WriteUnsigned(static_cast<RawBool*>(obj)->ptr()->value_);
|
||||
writer_->WriteUnsigned(
|
||||
static_cast<uintptr_t>(static_cast<RawBool*>(obj)->ptr()->value_));
|
||||
} else if (cid == kSmiCid) {
|
||||
UNREACHABLE();
|
||||
} else if (cid == kMintCid) {
|
||||
|
|
|
@ -599,7 +599,7 @@ char* OS::VSCreate(Zone* zone, const char* format, va_list args) {
|
|||
va_end(measure_args);
|
||||
|
||||
char* buffer;
|
||||
if (zone) {
|
||||
if (zone != nullptr) {
|
||||
buffer = zone->Alloc<char>(len + 1);
|
||||
} else {
|
||||
buffer = reinterpret_cast<char*>(malloc(len + 1));
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
#ifndef RUNTIME_VM_POINTER_TAGGING_H_
|
||||
#define RUNTIME_VM_POINTER_TAGGING_H_
|
||||
|
||||
#include "platform/assert.h"
|
||||
#include "platform/globals.h"
|
||||
|
||||
// This header defines constants associated with pointer tagging:
|
||||
//
|
||||
// * which bits determine whether or not this is a Smi value or a heap
|
||||
|
|
|
@ -76,7 +76,7 @@ char* ProcCpuInfo::FieldStart(const char* field) {
|
|||
|
||||
// Skip to the first colon followed by a space.
|
||||
p = strchr(p + fieldlen, ':');
|
||||
if (p == NULL || !isspace(p[1])) {
|
||||
if (p == NULL || (isspace(p[1]) == 0)) {
|
||||
return NULL;
|
||||
}
|
||||
p += 2;
|
||||
|
|
|
@ -3556,7 +3556,7 @@ class DotPrinter : public NodeVisitor {
|
|||
|
||||
void DotPrinter::PrintNode(const char* label, RegExpNode* node) {
|
||||
OS::PrintErr("digraph G {\n graph [label=\"");
|
||||
for (intptr_t i = 0; label[i]; i++) {
|
||||
for (intptr_t i = 0; label[i] != '\0'; i++) {
|
||||
switch (label[i]) {
|
||||
case '\\':
|
||||
OS::PrintErr("\\\\");
|
||||
|
@ -5286,7 +5286,7 @@ RegExpEngine::CompilationResult RegExpEngine::CompileIR(
|
|||
|
||||
const Function& function = parsed_function->function();
|
||||
const intptr_t specialization_cid = function.string_specialization_cid();
|
||||
const intptr_t is_sticky = function.is_sticky_specialization();
|
||||
const bool is_sticky = function.is_sticky_specialization();
|
||||
const bool is_one_byte = (specialization_cid == kOneByteStringCid ||
|
||||
specialization_cid == kExternalOneByteStringCid);
|
||||
RegExp& regexp = RegExp::Handle(zone, function.regexp());
|
||||
|
|
|
@ -204,10 +204,10 @@ class RegExpCharacterClass : public RegExpTree {
|
|||
// * : All characters
|
||||
uint16_t standard_type() const { return set_.standard_set_type(); }
|
||||
ZoneGrowableArray<CharacterRange>* ranges() { return set_.ranges(); }
|
||||
bool is_negated() const { return character_class_flags_ & NEGATED; }
|
||||
bool is_negated() const { return (character_class_flags_ & NEGATED) != 0; }
|
||||
RegExpFlags flags() const { return flags_; }
|
||||
bool contains_split_surrogate() const {
|
||||
return character_class_flags_ & CONTAINS_SPLIT_SURROGATE;
|
||||
return (character_class_flags_ & CONTAINS_SPLIT_SURROGATE) != 0;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -1506,7 +1506,7 @@ bool LookupPropertyValueName(UProperty property,
|
|||
UErrorCode ec = U_ZERO_ERROR;
|
||||
icu::UnicodeSet set;
|
||||
set.applyIntPropertyValue(property, property_value, ec);
|
||||
bool success = ec == U_ZERO_ERROR && !set.isEmpty();
|
||||
bool success = ec == U_ZERO_ERROR && (set.isEmpty() == 0);
|
||||
|
||||
if (success) {
|
||||
set.removeAllStrings();
|
||||
|
|
|
@ -2054,7 +2054,7 @@ static void HandleStackOverflowTestCases(Thread* thread) {
|
|||
}
|
||||
}
|
||||
if (FLAG_deoptimize_filter != nullptr || FLAG_stacktrace_filter != nullptr ||
|
||||
FLAG_reload_every) {
|
||||
(FLAG_reload_every != 0)) {
|
||||
DartFrameIterator iterator(thread,
|
||||
StackFrameIterator::kNoCrossThreadIteration);
|
||||
StackFrame* frame = iterator.NextFrame();
|
||||
|
@ -2753,11 +2753,11 @@ DEFINE_LEAF_RUNTIME_ENTRY(intptr_t,
|
|||
THR_Print("== Deoptimizing code for '%s', %s, %s\n",
|
||||
function.ToFullyQualifiedCString(),
|
||||
deoptimizing_code ? "code & frame" : "frame",
|
||||
is_lazy_deopt ? "lazy-deopt" : "");
|
||||
(is_lazy_deopt != 0u) ? "lazy-deopt" : "");
|
||||
}
|
||||
|
||||
#if !defined(TARGET_ARCH_DBC)
|
||||
if (is_lazy_deopt) {
|
||||
if (is_lazy_deopt != 0u) {
|
||||
uword deopt_pc = isolate->FindPendingDeopt(caller_frame->fp());
|
||||
if (FLAG_trace_deoptimization) {
|
||||
THR_Print("Lazy deopt fp=%" Pp " pc=%" Pp "\n", caller_frame->fp(),
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
#ifndef RUNTIME_VM_SCOPE_TIMER_H_
|
||||
#define RUNTIME_VM_SCOPE_TIMER_H_
|
||||
|
||||
#include "platform/allocation.h"
|
||||
#include "platform/globals.h"
|
||||
|
||||
#include "vm/os.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
// Simple utility class for timing a block of code.
|
||||
|
|
|
@ -60,7 +60,7 @@ class VariableIndex {
|
|||
|
||||
explicit VariableIndex(int value = kInvalidIndex) : value_(value) {}
|
||||
|
||||
int operator==(const VariableIndex& other) { return value_ == other.value_; }
|
||||
bool operator==(const VariableIndex& other) { return value_ == other.value_; }
|
||||
|
||||
bool IsValid() const { return value_ != kInvalidIndex; }
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ bool Service::ListenStream(const char* stream_id) {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (stream_listen_callback_) {
|
||||
if (stream_listen_callback_ != nullptr) {
|
||||
Thread* T = Thread::Current();
|
||||
TransitionVMToNative transition(T);
|
||||
return (*stream_listen_callback_)(stream_id);
|
||||
|
@ -165,7 +165,7 @@ void Service::CancelStream(const char* stream_id) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (stream_cancel_callback_) {
|
||||
if (stream_cancel_callback_ != nullptr) {
|
||||
Thread* T = Thread::Current();
|
||||
TransitionVMToNative transition(T);
|
||||
return (*stream_cancel_callback_)(stream_id);
|
||||
|
@ -2041,7 +2041,7 @@ static Breakpoint* LookupBreakpoint(Isolate* isolate,
|
|||
Breakpoint* bpt = NULL;
|
||||
if (GetIntegerId(rest, &bpt_id)) {
|
||||
bpt = isolate->debugger()->GetBreakpointById(bpt_id);
|
||||
if (bpt) {
|
||||
if (bpt != nullptr) {
|
||||
*result = ObjectIdRing::kValid;
|
||||
return bpt;
|
||||
}
|
||||
|
|
|
@ -636,7 +636,7 @@ RawApiError* SnapshotReader::VerifyVersionAndFeatures(Isolate* isolate) {
|
|||
|
||||
const char* version = reinterpret_cast<const char*>(CurrentBufferAddress());
|
||||
ASSERT(version != NULL);
|
||||
if (strncmp(version, expected_version, version_len)) {
|
||||
if (strncmp(version, expected_version, version_len) != 0) {
|
||||
const intptr_t kMessageBufferSize = 256;
|
||||
char message_buffer[kMessageBufferSize];
|
||||
char* actual_version = Utils::StrNDup(version, version_len);
|
||||
|
@ -660,7 +660,7 @@ RawApiError* SnapshotReader::VerifyVersionAndFeatures(Isolate* isolate) {
|
|||
ASSERT(features != NULL);
|
||||
intptr_t buffer_len = Utils::StrNLen(features, PendingBytes());
|
||||
if ((buffer_len != expected_len) ||
|
||||
strncmp(features, expected_features, expected_len)) {
|
||||
(strncmp(features, expected_features, expected_len) != 0)) {
|
||||
const intptr_t kMessageBufferSize = 256;
|
||||
char message_buffer[kMessageBufferSize];
|
||||
char* actual_features =
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#include "vm/source_report.h"
|
||||
|
||||
#include "vm/bit_vector.h"
|
||||
#include "vm/compiler/jit/compiler.h"
|
||||
#include "vm/isolate.h"
|
||||
#include "vm/kernel_loader.h"
|
||||
|
@ -330,11 +331,8 @@ void SourceReport::PrintPossibleBreakpointsData(JSONObject* jsobj,
|
|||
const TokenPosition begin_pos = func.token_pos();
|
||||
const TokenPosition end_pos = func.end_token_pos();
|
||||
intptr_t func_length = (end_pos.Pos() - begin_pos.Pos()) + 1;
|
||||
GrowableArray<char> possible(func_length);
|
||||
possible.SetLength(func_length);
|
||||
for (int i = 0; i < func_length; i++) {
|
||||
possible[i] = false;
|
||||
}
|
||||
|
||||
BitVector possible(zone(), func_length);
|
||||
|
||||
if (code.IsNull()) {
|
||||
const Bytecode& bytecode = Bytecode::Handle(func.bytecode());
|
||||
|
@ -354,7 +352,7 @@ void SourceReport::PrintPossibleBreakpointsData(JSONObject* jsobj,
|
|||
// source position range.
|
||||
if (bytecode.GetDebugCheckedOpcodeReturnAddress(
|
||||
pc_offset, iter.PcOffset()) != 0) {
|
||||
possible[token_offset] = true;
|
||||
possible.Add(token_offset);
|
||||
}
|
||||
pc_offset = kUwordMax;
|
||||
}
|
||||
|
@ -373,7 +371,7 @@ void SourceReport::PrintPossibleBreakpointsData(JSONObject* jsobj,
|
|||
}
|
||||
if (pc_offset != kUwordMax && bytecode.GetDebugCheckedOpcodeReturnAddress(
|
||||
pc_offset, bytecode.Size()) != 0) {
|
||||
possible[token_offset] = true;
|
||||
possible.Add(token_offset);
|
||||
}
|
||||
} else {
|
||||
const uint8_t kSafepointKind =
|
||||
|
@ -391,13 +389,13 @@ void SourceReport::PrintPossibleBreakpointsData(JSONObject* jsobj,
|
|||
continue;
|
||||
}
|
||||
intptr_t token_offset = token_pos.Pos() - begin_pos.Pos();
|
||||
possible[token_offset] = true;
|
||||
possible.Add(token_offset);
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray bpts(jsobj, "possibleBreakpoints");
|
||||
for (int i = 0; i < func_length; i++) {
|
||||
if (possible[i]) {
|
||||
if (possible.Contains(i)) {
|
||||
// Add the token position.
|
||||
bpts.AddValue(begin_pos.Pos() + i);
|
||||
}
|
||||
|
|
|
@ -515,8 +515,8 @@ bool StackFrame::FindExceptionHandler(Thread* thread,
|
|||
ExceptionHandlerInfo* info = cache->Lookup(pc());
|
||||
if (info != NULL) {
|
||||
*handler_pc = start + info->handler_pc_offset;
|
||||
*needs_stacktrace = info->needs_stacktrace;
|
||||
*has_catch_all = info->has_catch_all;
|
||||
*needs_stacktrace = (info->needs_stacktrace != 0);
|
||||
*has_catch_all = (info->has_catch_all != 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -544,8 +544,8 @@ bool StackFrame::FindExceptionHandler(Thread* thread,
|
|||
ExceptionHandlerInfo handler_info;
|
||||
handlers.GetHandlerInfo(try_index, &handler_info);
|
||||
*handler_pc = start + handler_info.handler_pc_offset;
|
||||
*needs_stacktrace = handler_info.needs_stacktrace;
|
||||
*has_catch_all = handler_info.has_catch_all;
|
||||
*needs_stacktrace = (handler_info.needs_stacktrace != 0);
|
||||
*has_catch_all = (handler_info.has_catch_all != 0);
|
||||
cache->Insert(pc(), handler_info);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_ARM_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_ARM_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_STACK_FRAME_H_)
|
||||
#error Do not include stack_frame_arm.h directly; use stack_frame.h instead.
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
/* ARM Dart Frame Layout
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_ARM64_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_ARM64_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_STACK_FRAME_H_)
|
||||
#error Do not include stack_frame_arm64.h directly; use stack_frame.h instead.
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
/* ARM64 Dart Frame Layout
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_DBC_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_DBC_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_STACK_FRAME_H_)
|
||||
#error Do not include stack_frame_dbc.h directly; use stack_frame.h instead.
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
/* DBC Frame Layout
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_IA32_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_IA32_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_STACK_FRAME_H_)
|
||||
#error Do not include stack_frame_ia32.h directly; use stack_frame.h instead.
|
||||
#endif
|
||||
|
||||
namespace dart {
|
||||
|
||||
/* IA32 Dart Frame Layout
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_KBC_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_KBC_H_
|
||||
|
||||
#include "platform/globals.h"
|
||||
|
||||
namespace dart {
|
||||
|
||||
/* Kernel Bytecode Frame Layout
|
||||
|
|
|
@ -149,7 +149,7 @@ static Dart_NativeFunction native_lookup(Dart_Handle name,
|
|||
int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries);
|
||||
for (int i = 0; i < num_entries; i++) {
|
||||
struct NativeEntries* entry = &(BuiltinEntries[i]);
|
||||
if (!strcmp(function_name, entry->name_) &&
|
||||
if ((strcmp(function_name, entry->name_) == 0) &&
|
||||
(entry->argument_count_ == argument_count)) {
|
||||
return reinterpret_cast<Dart_NativeFunction>(entry->function_);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#ifndef RUNTIME_VM_STACK_FRAME_X64_H_
|
||||
#define RUNTIME_VM_STACK_FRAME_X64_H_
|
||||
|
||||
#if !defined(RUNTIME_VM_STACK_FRAME_H_)
|
||||
#error Do not include stack_frame_x64.h directly; use stack_frame.h instead.
|
||||
#endif
|
||||
|
||||
#include "vm/constants_x64.h"
|
||||
|
||||
namespace dart {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#define RUNTIME_VM_STATIC_TYPE_EXACTNESS_STATE_H_
|
||||
|
||||
#include "platform/allocation.h"
|
||||
#include "platform/utils.h"
|
||||
|
||||
// This header defines the list of VM implementation classes and their ids.
|
||||
//
|
||||
|
|
|
@ -42,7 +42,7 @@ Thread::~Thread() {
|
|||
// There should be no top api scopes at this point.
|
||||
ASSERT(api_top_scope() == NULL);
|
||||
// Delete the resusable api scope if there is one.
|
||||
if (api_reusable_scope_) {
|
||||
if (api_reusable_scope_ != nullptr) {
|
||||
delete api_reusable_scope_;
|
||||
api_reusable_scope_ = NULL;
|
||||
}
|
||||
|
|
|
@ -737,10 +737,11 @@ TimelineStream::TimelineStream(const char* name,
|
|||
: name_(name),
|
||||
fuchsia_name_(fuchsia_name),
|
||||
#if defined(HOST_OS_FUCHSIA)
|
||||
enabled_(true) { // For generated code.
|
||||
enabled_(static_cast<uintptr_t>(true)) // For generated code.
|
||||
#else
|
||||
enabled_(enabled) {
|
||||
enabled_(static_cast<uintptr_t>(enabled))
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
TimelineEvent* TimelineStream::StartEvent() {
|
||||
|
|
Loading…
Reference in a new issue