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

Unified Diff: runtime/vm/code_generator_ia32.cc

Issue 9693020: Optional arguments in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | runtime/vm/code_generator_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 5412)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -369,6 +369,7 @@
// generated if only fixed parameters are declared, unless we are in debug
// mode or unless we are compiling a closure.
if (num_copied_params == 0) {
+ ASSERT(num_opt_params == 0);
#if defined(DEBUG)
const bool check_arguments = true; // Always check arguments in debug mode.
#else
@@ -382,14 +383,8 @@
Label argc_in_range;
// Total number of args is the first Smi in args descriptor array (EDX).
__ movl(EAX, FieldAddress(EDX, Array::data_offset()));
- if (num_opt_params == 0) {
- __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params)));
- __ j(EQUAL, &argc_in_range, Assembler::kNearJump);
- } else {
- __ subl(EAX, Immediate(Smi::RawValue(num_fixed_params)));
- __ cmpl(EAX, Immediate(Smi::RawValue(num_opt_params)));
- __ j(BELOW_EQUAL, &argc_in_range, Assembler::kNearJump);
- }
+ __ cmpl(EAX, Immediate(Smi::RawValue(num_fixed_params)));
+ __ j(EQUAL, &argc_in_range, Assembler::kNearJump);
if (function.IsClosureFunction()) {
GenerateCallRuntime(AstNode::kNoId,
0,
« no previous file with comments | « no previous file | runtime/vm/code_generator_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698