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

Unified Diff: runtime/vm/code_generator.cc

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
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 11998)
+++ runtime/vm/code_generator.cc (working copy)
@@ -1486,8 +1486,8 @@
const Function& function = Function::Handle(optimized_code.function());
// Do not copy incoming arguments if there are optional arguments (they
// are copied into local space at method entry).
- const intptr_t num_args = (function.num_optional_parameters() > 0) ?
- 0 : function.num_fixed_parameters();
+ const intptr_t num_args =
+ function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
// FP, PC-marker and return-address will be copied as well.
const intptr_t frame_copy_size =
1 // Deoptimized function's return address: caller_frame->pc().
@@ -1554,8 +1554,8 @@
// For functions with optional argument deoptimization info does not
// describe incoming arguments.
const Function& function = Function::Handle(optimized_code.function());
- const intptr_t num_args = (function.num_optional_parameters() > 0) ?
- 0 : function.num_fixed_parameters();
+ const intptr_t num_args =
+ function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
intptr_t unoptimized_stack_size =
+ deopt_info.Length() - num_args
- 2; // Subtract caller FP and PC.
@@ -1577,8 +1577,8 @@
intptr_t* start = reinterpret_cast<intptr_t*>(caller_frame.sp() - kWordSize);
const Function& function = Function::Handle(code.function());
- const intptr_t num_args = (function.num_optional_parameters() > 0) ?
- 0 : function.num_fixed_parameters();
+ const intptr_t num_args =
+ function.HasOptionalParameters() ? 0 : function.num_fixed_parameters();
intptr_t to_frame_size =
1 // Deoptimized function's return address.
+ (caller_frame.fp() - caller_frame.sp()) / kWordSize

Powered by Google App Engine
This is Rietveld 408576698