-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 39e240c into dev
- Loading branch information
Showing
16 changed files
with
266 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// 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:kernel/ast.dart'; | ||
import 'package:kernel/type_environment.dart'; | ||
import 'package:front_end/src/fasta/kernel/constant_evaluator.dart' as kernel; | ||
import 'package:kernel/core_types.dart'; | ||
import 'package:kernel/class_hierarchy.dart'; | ||
|
||
import 'package:vm/transformations/vm_constant_evaluator.dart'; | ||
|
||
import 'package:dart2wasm/compiler_options.dart'; | ||
import 'package:dart2wasm/target.dart'; | ||
|
||
class ConstantEvaluator extends kernel.ConstantEvaluator | ||
implements VMConstantEvaluator { | ||
ConstantEvaluator(WasmCompilerOptions options, WasmTarget target, | ||
Component component, CoreTypes coreTypes, ClassHierarchy classHierarchy) | ||
: super( | ||
target.dartLibrarySupport, | ||
target.constantsBackend, | ||
component, | ||
options.environment, | ||
TypeEnvironment(coreTypes, classHierarchy), | ||
const kernel.SimpleErrorReporter(), | ||
enableTripleShift: true, | ||
enableAsserts: options.translatorOptions.enableAsserts, | ||
errorOnUnevaluatedConstant: true, | ||
evaluationMode: kernel.EvaluationMode.strong, | ||
); | ||
|
||
@override | ||
bool shouldEvaluateMember(Member node) => false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.