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

Issue 10928160: Limit the maximum number of formal parameters (32K fixed and 32K optional) (Closed)

Created:
8 years, 3 months ago by regis
Modified:
8 years, 3 months ago
Reviewers:
siva
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Limit the maximum number of formal parameters (32K fixed and 32K optional) in order to save space in function objects. Naming cleanup. Committed: https://code.google.com/p/dart/source/detail?r=12288

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -127 lines) Patch
M runtime/lib/object.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/ast_printer.cc View 1 2 1 chunk +1 line, -4 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/code_generator_test.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/compiler.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 chunks +24 lines, -15 lines 0 comments Download
M runtime/vm/object.cc View 1 2 14 chunks +42 lines, -61 lines 0 comments Download
M runtime/vm/object_test.cc View 1 2 2 chunks +4 lines, -6 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 8 chunks +15 lines, -15 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 1 chunk +2 lines, -3 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 2 2 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
8 years, 3 months ago (2012-09-12 21:27:28 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/10928160/diff/1/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/10928160/diff/1/runtime/vm/object.cc#newcode3958 runtime/vm/object.cc:3958: set_num_optional_parameters((num_optional_positional_parameters > 0) ? ditto comment about >= ...
8 years, 3 months ago (2012-09-12 22:19:50 UTC) #2
regis
8 years, 3 months ago (2012-09-12 23:33:32 UTC) #3
Thanks!

https://codereview.chromium.org/10928160/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/10928160/diff/1/runtime/vm/object.cc#newcode3958
runtime/vm/object.cc:3958:
set_num_optional_parameters((num_optional_positional_parameters > 0) ?
On 2012/09/12 22:19:50, siva wrote:
> ditto comment about >= 0

The code is now different.

https://codereview.chromium.org/10928160/diff/1/runtime/vm/object.h
File runtime/vm/object.h (right):

https://codereview.chromium.org/10928160/diff/1/runtime/vm/object.h#newcode1483
runtime/vm/object.h:1483: return (num_opt_params > 0) ? num_opt_params :
-num_opt_params;
On 2012/09/12 22:19:50, siva wrote:
> Should this be (num_opt_params >= 0) ? num_opt_params: -num_opt_params;

I think it does not matter. But I agree it is easier to read with >= 0. Changed.

https://codereview.chromium.org/10928160/diff/1/runtime/vm/object.h#newcode1486
runtime/vm/object.h:1486: intptr_t num_optional_named_parameters) const;
On 2012/09/12 22:19:50, siva wrote:
> I feel this function would be more readable if the signature
> was:
> void SetNumOptionalParameters(intptr_t num_optional_params,
>                               bool are_position_optional);
> 
> That would make the invocation from the parser clearer.

Done.

Powered by Google App Engine
This is Rietveld 408576698