Skip to content

Commit

Permalink
Version 3.7.0-193.0.dev
Browse files Browse the repository at this point in the history
Merge d9502e2 into dev
  • Loading branch information
Dart CI committed Nov 27, 2024
2 parents cf4d2c2 + d9502e2 commit 5785058
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 71 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ vars = {
"boringssl_rev": "cd95210465496ac2337b313cf49f607762abe286",
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
"cpu_features_rev": "936b9ab5515dead115606559502e3864958f7f6e",
"devtools_rev": "3642846c465888b0c56271fe9265a0901f1803f6",
"devtools_rev": "3e5327a02693b1405359dc5322d7f0a40151b9b7",
"icu_rev": "43953f57b037778a1b8005564afabe214834f7bd",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
"libcxx_rev": "44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0",
Expand Down
30 changes: 21 additions & 9 deletions pkg/dartdev/lib/src/sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,25 @@ class Sdk {
'dartdevc.dart.snapshot',
);

String get ddcAotSnapshot => _snapshotPathFor(
'dartdevc_aot.dart.snapshot',
);
String get ddcAotSnapshot => _runFromBuildRoot
? _snapshotPathFor(
'dartdevc_aot_product.dart.snapshot',
)
: _snapshotPathFor(
'dartdevc_aot.dart.snapshot',
);

String get dart2jsSnapshot => _snapshotPathFor(
'dart2js.dart.snapshot',
);

String get dart2jsAotSnapshot => _snapshotPathFor(
'dart2js_aot.dart.snapshot',
);
String get dart2jsAotSnapshot => _runFromBuildRoot
? _snapshotPathFor(
'dart2js_aot_product.dart.snapshot',
)
: _snapshotPathFor(
'dart2js_aot.dart.snapshot',
);

String get dart2wasmSnapshot => _snapshotPathFor(
'dart2wasm_product.snapshot',
Expand All @@ -99,9 +107,13 @@ class Sdk {
'frontend_server.dart.snapshot',
);

String get frontendServerAotSnapshot => _snapshotPathFor(
'frontend_server_aot.dart.snapshot',
);
String get frontendServerAotSnapshot => _runFromBuildRoot
? _snapshotPathFor(
'frontend_server_aot_product.dart.snapshot',
)
: _snapshotPathFor(
'frontend_server_aot.dart.snapshot',
);

String get dtdSnapshot => _snapshotPathFor(
'dart_tooling_daemon.dart.snapshot',
Expand Down
8 changes: 4 additions & 4 deletions pkg/dds/test/dap_handler_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'package:vm_service/vm_service_io.dart';

import 'common/test_helper.dart';

Future<Isolate> waitForFirstRunnableIsolate(VmService service) async {
Future<Isolate> waitForFirstPausedRunnableIsolate(VmService service) async {
VM vm;
do {
vm = await service.getVM();
Expand All @@ -24,7 +24,7 @@ Future<Isolate> waitForFirstRunnableIsolate(VmService service) async {
Isolate isolate;
do {
isolate = await service.getIsolate(isolateId);
} while (!isolate.runnable!);
} while (!isolate.runnable! || isolate.pauseEvent == null);
return isolate;
}

Expand Down Expand Up @@ -131,7 +131,7 @@ void main() {

// Wait for the isolate to become runnable as `evaluateInFrame` requires
// the isolate to be runnable.
final isolate = await waitForFirstRunnableIsolate(service);
final isolate = await waitForFirstPausedRunnableIsolate(service);
final isolateId = isolate.id!;

// Get the variable for 'myInstance'.
Expand Down Expand Up @@ -178,7 +178,7 @@ void main() {
service = await vmServiceConnectUri(dds!.wsUri!.toString());

// Get the expected isolateId.
final isolate = await waitForFirstRunnableIsolate(service);
final isolate = await waitForFirstPausedRunnableIsolate(service);
final isolateId = isolate.id!;

// Ask DAP for all threads.
Expand Down
2 changes: 2 additions & 0 deletions pkg/pkg.status
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ vm_service/test/eval_*test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/evaluate_*test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/external_compilation_service_test: SkipByDesign # Spawns a secondary process.
vm_service/test/field_script_test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/forward_compile_expression_error_from_external_client_with_dds_test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/forward_compile_expression_error_from_external_client_without_dds_test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/get_allocation_traces_test: SkipByDesign # Debugger is disabled in AOT mode.
vm_service/test/get_instances_as_*: SkipByDesign # Debugger is disabled in AOT mode
vm_service/test/get_instances_rpc_test: SkipByDesign # Debugger is disabled in AOT mode.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart';
import 'package:vm_service/vm_service_io.dart' show vmServiceConnectUri;

import 'common/service_test_common.dart';

final tests = <IsolateTest>[
hasStoppedAtExit,
(VmService primaryClient, IsolateRef isolateRef) async {
const expressionCompilationFailedMessage = 'Expresion compilation failed';

final secondaryClient = await vmServiceConnectUri(primaryClient.wsUri!);
secondaryClient.registerServiceCallback('compileExpression',
(params) async {
return {
'jsonrpc': '2.0',
'id': 0,
'error': {
'code': RPCErrorKind.kExpressionCompilationError.code,
'message': expressionCompilationFailedMessage,
'data': {'details': expressionCompilationFailedMessage},
},
};
});
await secondaryClient.registerService(
'compileExpression',
'Custom Expression Compilation',
);

final isolateId = isolateRef.id!;
try {
final isolate = await primaryClient.getIsolate(isolateId);
await primaryClient.evaluate(isolateId, isolate.rootLib!.id!, '123');
fail('Expected to catch an RPCError');
} on RPCError catch (e) {
expect(e.code, RPCErrorKind.kExpressionCompilationError.code);
// [e.details] used to be the string
// "{code: 113, message: Expresion compilation failed, data: ...}", so we
// want to avoid regressing to that behaviour.
expect(e.details, expressionCompilationFailedMessage);
}
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// This is a regression test for https://dartbug.com/59603.

import 'common/test_helper.dart';
import 'forward_compile_expression_error_from_external_client_test_common.dart';

void main([args = const <String>[]]) => runIsolateTests(
args,
tests,
'forward_compile_expression_error_from_external_client_with_dds_test.dart',
pauseOnExit: true,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// This is a regression test for https://dartbug.com/59603.

import 'common/test_helper.dart';
import 'forward_compile_expression_error_from_external_client_test_common.dart';

void main([args = const <String>[]]) => runIsolateTests(
args,
tests,
'forward_compile_expression_error_from_external_client_without_dds_test.dart',
pauseOnExit: true,
extraArgs: ['--no-dds'],
);
22 changes: 22 additions & 0 deletions runtime/tests/vm/dart/regress_59611_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// The Dart Project Fuzz Tester (1.101).
// Program generated as:
// dart dartfuzz.dart --seed 1868073336 --no-fp --no-ffi --flat
// @dart=2.14

// VMOptions=--optimization_counter_threshold=1 --use-slow-path --deterministic

import "dart:typed_data";

Uint8ClampedList var9 = Uint8ClampedList(40);
bool var109 = true;
int var112 = 5;

main() {
for (int loc0 = 0; loc0 < 41; loc0++) {
var112 = var9[27] >>> (var109 ? 38 : 255);
}
}
97 changes: 97 additions & 0 deletions runtime/tests/vm/dart/smi_ops_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// VMOptions=--optimization-counter-threshold=50 --no-background-compilation

import "package:expect/expect.dart";

@pragma("vm:never-inline")
dynamic smi_add(dynamic x, dynamic y) => x + y;

@pragma("vm:never-inline")
dynamic smi_sub(dynamic x, dynamic y) => x - y;

@pragma("vm:never-inline")
dynamic smi_mul(dynamic x, dynamic y) => x * y;

@pragma("vm:never-inline")
dynamic smi_and(dynamic x, dynamic y) => x & y;

@pragma("vm:never-inline")
dynamic smi_or(dynamic x, dynamic y) => x | y;

@pragma("vm:never-inline")
dynamic smi_xor(dynamic x, dynamic y) => x ^ y;

@pragma("vm:never-inline")
dynamic smi_div(dynamic x, dynamic y) => x ~/ y;

@pragma("vm:never-inline")
dynamic smi_mod(dynamic x, dynamic y) => x % y;

@pragma("vm:never-inline")
dynamic smi_sll(dynamic x, dynamic y) => x << y;

@pragma("vm:never-inline")
dynamic smi_sra(dynamic x, dynamic y) => x >> y;

@pragma("vm:never-inline")
dynamic smi_srl(dynamic x, dynamic y) => x >>> y;

testSmi() {
Expect.equals(7, smi_add(3, 4));
Expect.equals(-1, smi_sub(3, 4));
Expect.equals(12, smi_mul(3, 4));
Expect.equals(0, smi_and(3, 4));
Expect.equals(7, smi_or(3, 4));
Expect.equals(7, smi_xor(3, 4));
Expect.equals(0, smi_div(3, 4));
Expect.equals(3, smi_mod(3, 4));
Expect.equals(48, smi_sll(3, 4));
Expect.equals(0, smi_sra(3, 4));
Expect.equals(0, smi_srl(3, 4));
}

const maxSmi32 = 0x3FFFFFFF;
const maxSmi64 = 0x3FFFFFFFFFFFFFFF;
const minSmi32 = -0x80000000;
const minSmi64 = -0x8000000000000000;

testSmiDeopt() {
Expect.equals(0x40000000, smi_add(maxSmi32, 1));
Expect.equals(0x4000000000000000, smi_add(maxSmi64, 1));

Expect.equals(0x40000000, smi_sub(maxSmi32, -1));
Expect.equals(0x4000000000000000, smi_sub(maxSmi64, -1));

Expect.equals(0x7FFFFFFE, smi_mul(maxSmi32, 2));
Expect.equals(0x7FFFFFFFFFFFFFFE, smi_mul(maxSmi64, 2));

Expect.equals(0x80000000, smi_div(minSmi32, -1));
Expect.equals(0x8000000000000000, smi_div(minSmi64, -1));

Expect.throws(() => smi_mod(minSmi32, 0));
Expect.throws(() => smi_mod(minSmi64, 0));

Expect.equals(0x7FFFFFFE, smi_sll(maxSmi32, 1));
Expect.equals(0x7FFFFFFFFFFFFFFE, smi_sll(maxSmi64, 1));

Expect.equals(0, smi_sra(maxSmi32, 65));
Expect.equals(0, smi_sra(maxSmi64, 65));

Expect.equals(0, smi_srl(minSmi32, 65));
Expect.equals(0, smi_srl(minSmi64, 65));
}

main() {
for (int i = 0; i < 200; i++) {
testSmi();
}

print("=================================");

for (int i = 0; i < 200; i++) {
testSmiDeopt();
}
}
8 changes: 6 additions & 2 deletions runtime/vm/compiler/backend/il_riscv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3233,8 +3233,11 @@ LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
if (kNumTemps == 1) {
summary->set_temp(0, Location::RequiresRegister());
}
summary->set_out(0, CanDeoptimize() ? Location::RequiresRegister()
: Location::MayBeSameAsFirstInput());
if (CanDeoptimize() || (op_kind() == Token::kUSHR)) {
summary->set_out(0, Location::RequiresRegister());
} else {
summary->set_out(0, Location::MayBeSameAsFirstInput());
}
return summary;
}

Expand Down Expand Up @@ -3491,6 +3494,7 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler::Label done, adjust;
__ bgez(result, &done, compiler::Assembler::kNearJump);
// Result is negative, adjust it.
ASSERT(result != right);
__ bgez(right, &adjust, compiler::Assembler::kNearJump);
__ sub(result, result, TMP2);
__ j(&done, compiler::Assembler::kNearJump);
Expand Down
Loading

0 comments on commit 5785058

Please sign in to comment.