Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(813)

Unified Diff: runtime/vm/object.h

Issue 10910119: Implement new optional parameters syntax in the vm (issue 4290). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 12003)
+++ runtime/vm/object.h (working copy)
@@ -1470,22 +1470,26 @@
raw_ptr()->end_token_pos_ = value;
}
- static intptr_t num_fixed_parameters_offset() {
- return OFFSET_OF(RawFunction, num_fixed_parameters_);
- }
intptr_t num_fixed_parameters() const {
return raw_ptr()->num_fixed_parameters_;
}
void set_num_fixed_parameters(intptr_t value) const;
- static intptr_t num_optional_parameters_offset() {
- return OFFSET_OF(RawFunction, num_optional_parameters_);
+ bool HasOptionalParameters() const {
+ return (num_optional_positional_parameters() +
+ num_optional_named_parameters()) > 0;
}
- intptr_t num_optional_parameters() const {
- return raw_ptr()->num_optional_parameters_;
+
+ intptr_t num_optional_positional_parameters() const {
+ return raw_ptr()->num_optional_positional_parameters_;
}
- void set_num_optional_parameters(intptr_t value) const;
+ void set_num_optional_positional_parameters(intptr_t value) const;
+ intptr_t num_optional_named_parameters() const {
+ return raw_ptr()->num_optional_named_parameters_;
+ }
+ void set_num_optional_named_parameters(intptr_t value) const;
+
static intptr_t usage_counter_offset() {
return OFFSET_OF(RawFunction, usage_counter_);
}
@@ -1521,6 +1525,9 @@
intptr_t NumberOfParameters() const;
intptr_t NumberOfImplicitParameters() const;
+ void SetNumberOfParameters(intptr_t num_fixed_parameters,
+ intptr_t num_optional_parameters,
+ bool are_optional_positional) const;
// Returns true if the argument counts are valid for calling this function.
// Otherwise, it returns false and the reason (if error_message is not NULL).
@@ -1666,8 +1673,8 @@
void set_name(const String& value) const;
void set_kind(RawFunction::Kind value) const;
- void set_is_static(bool is_static) const;
- void set_is_const(bool is_const) const;
+ void set_is_static(bool value) const;
+ void set_is_const(bool value) const;
void set_is_external(bool value) const;
void set_parent_function(const Function& value) const;
void set_owner(const Object& value) const;
@@ -1692,6 +1699,7 @@
// and the type of the other function.
bool TestParameterType(TypeTestKind test_kind,
intptr_t parameter_position,
+ intptr_t other_parameter_position,
const AbstractTypeArguments& type_arguments,
const Function& other,
const AbstractTypeArguments& other_type_arguments,
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698