Files
sdk/runtime/lib/function.dart
T
Régis Crelier fd5089c9e8 Remove parent_level field of function type parameters.
Add function_type_arguments field in closure instances.
Lots of other smaller changes, also related to generic function semantics.
This is still work in progress, with a change of direction in the design:
The type argument vector of a generic function will be prepended with the type
arguments of enclosing generic functions. The re-allocation and concatenation
will be done in nested generic function's prolog. This will greatly simplify
instantiation of types at run time without having to search the context for
parent function's type arguments. However, a closure instance now requires an
additional field. On the other hand, type parameters do not require a
parent_level field anymore.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2818273002 .
2017-04-17 08:58:24 -07:00

27 lines
1012 B
Dart

// Copyright (c) 2013, 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.
class _Closure implements Function {
bool operator ==(other) native "Closure_equals";
int get hashCode native "Closure_hashCode";
_Closure get call => this;
_Closure _clone() native "Closure_clone";
// No instance fields should be declared before the following 4 fields whose
// offsets must be identical in Dart and C++.
// The following 4 fields are declared both in raw_object.h (for direct access
// from C++ code) and also here so that the offset-to-field map used by
// deferred objects is properly initialized.
// Caution: These fields are not Dart instances, but VM objects. Their Dart
// names do not need to match the C++ names, but they must be private.
var _instantiator_type_arguments;
var _function_type_arguments;
var _function;
var _context;
}