OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
10 | 10 |
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2640 | 2640 |
2641 void FlowGraphBuilder::InlineBailout(const char* reason) { | 2641 void FlowGraphBuilder::InlineBailout(const char* reason) { |
2642 bool is_inlining = exit_collector_ != NULL; | 2642 bool is_inlining = exit_collector_ != NULL; |
2643 if (is_inlining) { | 2643 if (is_inlining) { |
2644 parsed_function_->function().set_is_inlinable(false); | 2644 parsed_function_->function().set_is_inlinable(false); |
2645 parsed_function_->Bailout("kernel::FlowGraphBuilder", reason); | 2645 parsed_function_->Bailout("kernel::FlowGraphBuilder", reason); |
2646 } | 2646 } |
2647 } | 2647 } |
2648 | 2648 |
2649 | 2649 |
2650 void FlowGraphBuilder::PruneUnreachableIfOSR() { | |
2651 // When compiling for OSR, use a depth first search to prune instructions | |
2652 // unreachable from the OSR entry. Catch entries are always considered | |
2653 // reachable, even if they become unreachable after OSR. | |
2654 if (osr_id_ != Compiler::kNoOSRDeoptId) { | |
2655 BitVector* block_marks = new(Z) BitVector(Z, next_block_id_); | |
2656 bool found = graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, | |
2657 block_marks); | |
2658 ASSERT(found); | |
2659 } | |
2660 } | |
2661 | |
2662 | |
2650 FlowGraph* FlowGraphBuilder::BuildGraph() { | 2663 FlowGraph* FlowGraphBuilder::BuildGraph() { |
2651 const dart::Function& function = parsed_function_->function(); | 2664 const dart::Function& function = parsed_function_->function(); |
2652 | 2665 |
2653 if (function.IsConstructorClosureFunction()) return NULL; | 2666 if (function.IsConstructorClosureFunction()) return NULL; |
2654 | 2667 |
2655 dart::Class& klass = | 2668 dart::Class& klass = |
2656 dart::Class::Handle(zone_, parsed_function_->function().Owner()); | 2669 dart::Class::Handle(zone_, parsed_function_->function().Owner()); |
2657 | 2670 |
2658 // Find out if there is an enclosing kernel class (which will be used to | 2671 // Find out if there is an enclosing kernel class (which will be used to |
2659 // resolve type parameters). | 2672 // resolve type parameters). |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2743 UNREACHABLE(); | 2756 UNREACHABLE(); |
2744 return NULL; | 2757 return NULL; |
2745 } | 2758 } |
2746 | 2759 |
2747 | 2760 |
2748 FlowGraph* FlowGraphBuilder::BuildGraphOfFunction(FunctionNode* function, | 2761 FlowGraph* FlowGraphBuilder::BuildGraphOfFunction(FunctionNode* function, |
2749 Constructor* constructor) { | 2762 Constructor* constructor) { |
2750 const Function& dart_function = parsed_function_->function(); | 2763 const Function& dart_function = parsed_function_->function(); |
2751 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 2764 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
2752 graph_entry_ = new (Z) | 2765 graph_entry_ = new (Z) |
2753 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 2766 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
2754 | 2767 |
2755 SetupDefaultParameterValues(function); | 2768 SetupDefaultParameterValues(function); |
2756 | 2769 |
2757 Fragment body; | 2770 Fragment body; |
2758 if (!dart_function.is_native()) body += CheckStackOverflowInPrologue(); | 2771 if (!dart_function.is_native()) body += CheckStackOverflowInPrologue(); |
2759 intptr_t context_size = | 2772 intptr_t context_size = |
2760 parsed_function_->node_sequence()->scope()->num_context_variables(); | 2773 parsed_function_->node_sequence()->scope()->num_context_variables(); |
2761 if (context_size > 0) { | 2774 if (context_size > 0) { |
2762 body += PushContext(context_size); | 2775 body += PushContext(context_size); |
2763 LocalVariable* context = MakeTemporary(); | 2776 LocalVariable* context = MakeTemporary(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2910 // False branch will contain the next comparison. | 2923 // False branch will contain the next comparison. |
2911 dispatch = Fragment(dispatch.entry, otherwise); | 2924 dispatch = Fragment(dispatch.entry, otherwise); |
2912 block = otherwise; | 2925 block = otherwise; |
2913 } | 2926 } |
2914 body = dispatch; | 2927 body = dispatch; |
2915 | 2928 |
2916 context_depth_ = current_context_depth; | 2929 context_depth_ = current_context_depth; |
2917 } | 2930 } |
2918 normal_entry->LinkTo(body.entry); | 2931 normal_entry->LinkTo(body.entry); |
2919 | 2932 |
2933 PruneUnreachableIfOSR(); | |
Vyacheslav Egorov (Google)
2016/10/31 17:46:37
I think only this one can OSR - inline the functi
kustermann
2016/10/31 18:18:13
Done.
| |
2920 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 2934 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
2921 } | 2935 } |
2922 | 2936 |
2923 | 2937 |
2924 Fragment FlowGraphBuilder::NativeFunctionBody(FunctionNode* kernel_function, | 2938 Fragment FlowGraphBuilder::NativeFunctionBody(FunctionNode* kernel_function, |
2925 const Function& function) { | 2939 const Function& function) { |
2926 ASSERT(function.is_native()); | 2940 ASSERT(function.is_native()); |
2927 // We explicitly build the graph for native functions in the same way that the | 2941 // We explicitly build the graph for native functions in the same way that the |
2928 // from-source backend does. We should find a way to have a single component | 2942 // from-source backend does. We should find a way to have a single component |
2929 // to build these graphs so that this code is not duplicated. | 2943 // to build these graphs so that this code is not duplicated. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3081 Field* kernel_field, LocalVariable* setter_value) { | 3095 Field* kernel_field, LocalVariable* setter_value) { |
3082 const dart::Function& function = parsed_function_->function(); | 3096 const dart::Function& function = parsed_function_->function(); |
3083 | 3097 |
3084 bool is_setter = function.IsImplicitSetterFunction(); | 3098 bool is_setter = function.IsImplicitSetterFunction(); |
3085 bool is_method = !function.IsStaticFunction(); | 3099 bool is_method = !function.IsStaticFunction(); |
3086 dart::Field& field = | 3100 dart::Field& field = |
3087 dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field)); | 3101 dart::Field::ZoneHandle(Z, H.LookupFieldByKernelField(kernel_field)); |
3088 | 3102 |
3089 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3103 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3090 graph_entry_ = new (Z) | 3104 graph_entry_ = new (Z) |
3091 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3105 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3092 | 3106 |
3093 // TODO(27590): Add support for FLAG_use_field_guards. | 3107 // TODO(27590): Add support for FLAG_use_field_guards. |
3094 Fragment body(normal_entry); | 3108 Fragment body(normal_entry); |
3095 if (is_setter) { | 3109 if (is_setter) { |
3096 if (is_method) { | 3110 if (is_method) { |
3097 body += LoadLocal(scopes_->this_variable); | 3111 body += LoadLocal(scopes_->this_variable); |
3098 body += LoadLocal(setter_value); | 3112 body += LoadLocal(setter_value); |
3099 body += StoreInstanceField(field); | 3113 body += StoreInstanceField(field); |
3100 } else { | 3114 } else { |
3101 body += LoadLocal(setter_value); | 3115 body += LoadLocal(setter_value); |
(...skipping 17 matching lines...) Expand all Loading... | |
3119 // The field always has an initializer because static fields without | 3133 // The field always has an initializer because static fields without |
3120 // initializers are initialized eagerly and do not have implicit getters. | 3134 // initializers are initialized eagerly and do not have implicit getters. |
3121 ASSERT(field.has_initializer()); | 3135 ASSERT(field.has_initializer()); |
3122 body += Constant(field); | 3136 body += Constant(field); |
3123 body += InitStaticField(field); | 3137 body += InitStaticField(field); |
3124 body += Constant(field); | 3138 body += Constant(field); |
3125 body += LoadStaticField(); | 3139 body += LoadStaticField(); |
3126 } | 3140 } |
3127 body += Return(); | 3141 body += Return(); |
3128 | 3142 |
3143 PruneUnreachableIfOSR(); | |
Vyacheslav Egorov (Google)
2016/10/31 17:46:37
I don't think this and below can be OSRed.
kustermann
2016/10/31 18:18:13
Done.
| |
3129 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3144 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3130 } | 3145 } |
3131 | 3146 |
3132 | 3147 |
3133 FlowGraph* FlowGraphBuilder::BuildGraphOfStaticFieldInitializer( | 3148 FlowGraph* FlowGraphBuilder::BuildGraphOfStaticFieldInitializer( |
3134 Field* kernel_field) { | 3149 Field* kernel_field) { |
3135 ASSERT(kernel_field->IsStatic()); | 3150 ASSERT(kernel_field->IsStatic()); |
3136 | 3151 |
3137 Expression* initializer = kernel_field->initializer(); | 3152 Expression* initializer = kernel_field->initializer(); |
3138 | 3153 |
3139 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3154 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3140 graph_entry_ = new (Z) | 3155 graph_entry_ = new (Z) |
3141 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3156 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3142 | 3157 |
3143 Fragment body(normal_entry); | 3158 Fragment body(normal_entry); |
3144 body += CheckStackOverflowInPrologue(); | 3159 body += CheckStackOverflowInPrologue(); |
3145 if (kernel_field->IsConst()) { | 3160 if (kernel_field->IsConst()) { |
3146 body += Constant(constant_evaluator_.EvaluateExpression(initializer)); | 3161 body += Constant(constant_evaluator_.EvaluateExpression(initializer)); |
3147 } else { | 3162 } else { |
3148 body += TranslateExpression(initializer); | 3163 body += TranslateExpression(initializer); |
3149 } | 3164 } |
3150 body += Return(); | 3165 body += Return(); |
3151 | 3166 |
3167 PruneUnreachableIfOSR(); | |
3152 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3168 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3153 } | 3169 } |
3154 | 3170 |
3155 | 3171 |
3156 Fragment FlowGraphBuilder::BuildImplicitClosureCreation( | 3172 Fragment FlowGraphBuilder::BuildImplicitClosureCreation( |
3157 const Function& target) { | 3173 const Function& target) { |
3158 Fragment fragment; | 3174 Fragment fragment; |
3159 const dart::Class& closure_class = | 3175 const dart::Class& closure_class = |
3160 dart::Class::ZoneHandle(Z, I->object_store()->closure_class()); | 3176 dart::Class::ZoneHandle(Z, I->object_store()->closure_class()); |
3161 fragment += AllocateObject(closure_class, target); | 3177 fragment += AllocateObject(closure_class, target); |
(...skipping 23 matching lines...) Expand all Loading... | |
3185 | 3201 |
3186 | 3202 |
3187 FlowGraph* FlowGraphBuilder::BuildGraphOfMethodExtractor( | 3203 FlowGraph* FlowGraphBuilder::BuildGraphOfMethodExtractor( |
3188 const Function& method) { | 3204 const Function& method) { |
3189 // A method extractor is the implicit getter for a method. | 3205 // A method extractor is the implicit getter for a method. |
3190 const Function& function = | 3206 const Function& function = |
3191 Function::ZoneHandle(Z, method.extracted_method_closure()); | 3207 Function::ZoneHandle(Z, method.extracted_method_closure()); |
3192 | 3208 |
3193 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3209 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3194 graph_entry_ = new (Z) | 3210 graph_entry_ = new (Z) |
3195 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3211 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3196 Fragment body(normal_entry); | 3212 Fragment body(normal_entry); |
3197 body += CheckStackOverflowInPrologue(); | 3213 body += CheckStackOverflowInPrologue(); |
3198 body += BuildImplicitClosureCreation(function); | 3214 body += BuildImplicitClosureCreation(function); |
3199 body += Return(); | 3215 body += Return(); |
3200 | 3216 |
3217 PruneUnreachableIfOSR(); | |
3201 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3218 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3202 } | 3219 } |
3203 | 3220 |
3204 | 3221 |
3205 FlowGraph* FlowGraphBuilder::BuildGraphOfImplicitClosureFunction( | 3222 FlowGraph* FlowGraphBuilder::BuildGraphOfImplicitClosureFunction( |
3206 FunctionNode* kernel_function, const Function& function) { | 3223 FunctionNode* kernel_function, const Function& function) { |
3207 const Function& target = Function::ZoneHandle(Z, function.parent_function()); | 3224 const Function& target = Function::ZoneHandle(Z, function.parent_function()); |
3208 | 3225 |
3209 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3226 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3210 graph_entry_ = new (Z) | 3227 graph_entry_ = new (Z) |
3211 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3228 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3212 SetupDefaultParameterValues(kernel_function); | 3229 SetupDefaultParameterValues(kernel_function); |
3213 | 3230 |
3214 Fragment body(normal_entry); | 3231 Fragment body(normal_entry); |
3215 body += CheckStackOverflowInPrologue(); | 3232 body += CheckStackOverflowInPrologue(); |
3216 | 3233 |
3217 // Load all the arguments. | 3234 // Load all the arguments. |
3218 if (!target.is_static()) { | 3235 if (!target.is_static()) { |
3219 // The context has a fixed shape: a single variable which is the | 3236 // The context has a fixed shape: a single variable which is the |
3220 // closed-over receiver. | 3237 // closed-over receiver. |
3221 body += LoadLocal(parsed_function_->current_context_var()); | 3238 body += LoadLocal(parsed_function_->current_context_var()); |
(...skipping 19 matching lines...) Expand all Loading... | |
3241 } | 3258 } |
3242 } | 3259 } |
3243 // Forward them to the target. | 3260 // Forward them to the target. |
3244 intptr_t argument_count = positional_argument_count + named_argument_count; | 3261 intptr_t argument_count = positional_argument_count + named_argument_count; |
3245 if (!target.is_static()) ++argument_count; | 3262 if (!target.is_static()) ++argument_count; |
3246 body += StaticCall(target, argument_count, argument_names); | 3263 body += StaticCall(target, argument_count, argument_names); |
3247 | 3264 |
3248 // Return the result. | 3265 // Return the result. |
3249 body += Return(); | 3266 body += Return(); |
3250 | 3267 |
3268 PruneUnreachableIfOSR(); | |
3251 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3269 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3252 } | 3270 } |
3253 | 3271 |
3254 | 3272 |
3255 FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher( | 3273 FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher( |
3256 const Function& function) { | 3274 const Function& function) { |
3257 // This function is specialized for a receiver class, a method name, and | 3275 // This function is specialized for a receiver class, a method name, and |
3258 // the arguments descriptor at a call site. | 3276 // the arguments descriptor at a call site. |
3259 | 3277 |
3260 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3278 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3261 graph_entry_ = new (Z) | 3279 graph_entry_ = new (Z) |
3262 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3280 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3263 | 3281 |
3264 // The backend will expect an array of default values for all the named | 3282 // The backend will expect an array of default values for all the named |
3265 // parameters, even if they are all known to be passed at the call site | 3283 // parameters, even if they are all known to be passed at the call site |
3266 // because the call site matches the arguments descriptor. Use null for | 3284 // because the call site matches the arguments descriptor. Use null for |
3267 // the default values. | 3285 // the default values. |
3268 const Array& descriptor_array = | 3286 const Array& descriptor_array = |
3269 Array::ZoneHandle(Z, function.saved_args_desc()); | 3287 Array::ZoneHandle(Z, function.saved_args_desc()); |
3270 ArgumentsDescriptor descriptor(descriptor_array); | 3288 ArgumentsDescriptor descriptor(descriptor_array); |
3271 ZoneGrowableArray<const Instance*>* default_values = | 3289 ZoneGrowableArray<const Instance*>* default_values = |
3272 new ZoneGrowableArray<const Instance*>(Z, descriptor.NamedCount()); | 3290 new ZoneGrowableArray<const Instance*>(Z, descriptor.NamedCount()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3342 if (no_such_method.IsNull()) { | 3360 if (no_such_method.IsNull()) { |
3343 // If noSuchMethod is not found on the receiver class, call | 3361 // If noSuchMethod is not found on the receiver class, call |
3344 // Object.noSuchMethod. | 3362 // Object.noSuchMethod. |
3345 no_such_method = Resolver::ResolveDynamicForReceiverClass( | 3363 no_such_method = Resolver::ResolveDynamicForReceiverClass( |
3346 dart::Class::Handle(Z, I->object_store()->object_class()), | 3364 dart::Class::Handle(Z, I->object_store()->object_class()), |
3347 Symbols::NoSuchMethod(), two_arguments); | 3365 Symbols::NoSuchMethod(), two_arguments); |
3348 } | 3366 } |
3349 body += StaticCall(no_such_method, 2); | 3367 body += StaticCall(no_such_method, 2); |
3350 body += Return(); | 3368 body += Return(); |
3351 | 3369 |
3370 PruneUnreachableIfOSR(); | |
3352 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3371 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3353 } | 3372 } |
3354 | 3373 |
3355 | 3374 |
3356 FlowGraph* FlowGraphBuilder::BuildGraphOfInvokeFieldDispatcher( | 3375 FlowGraph* FlowGraphBuilder::BuildGraphOfInvokeFieldDispatcher( |
3357 const Function& function) { | 3376 const Function& function) { |
3358 // Find the name of the field we should dispatch to. | 3377 // Find the name of the field we should dispatch to. |
3359 const dart::Class& owner = dart::Class::Handle(Z, function.Owner()); | 3378 const dart::Class& owner = dart::Class::Handle(Z, function.Owner()); |
3360 ASSERT(!owner.IsNull()); | 3379 ASSERT(!owner.IsNull()); |
3361 const dart::String& field_name = dart::String::Handle(Z, function.name()); | 3380 const dart::String& field_name = dart::String::Handle(Z, function.name()); |
(...skipping 24 matching lines...) Expand all Loading... | |
3386 dart::String& string_handle = dart::String::Handle(Z); | 3405 dart::String& string_handle = dart::String::Handle(Z); |
3387 for (intptr_t i = 0; i < descriptor.NamedCount(); ++i) { | 3406 for (intptr_t i = 0; i < descriptor.NamedCount(); ++i) { |
3388 default_values->Add(&Object::null_instance()); | 3407 default_values->Add(&Object::null_instance()); |
3389 string_handle = descriptor.NameAt(i); | 3408 string_handle = descriptor.NameAt(i); |
3390 argument_names.SetAt(i, string_handle); | 3409 argument_names.SetAt(i, string_handle); |
3391 } | 3410 } |
3392 parsed_function_->set_default_parameter_values(default_values); | 3411 parsed_function_->set_default_parameter_values(default_values); |
3393 | 3412 |
3394 TargetEntryInstr* normal_entry = BuildTargetEntry(); | 3413 TargetEntryInstr* normal_entry = BuildTargetEntry(); |
3395 graph_entry_ = new (Z) | 3414 graph_entry_ = new (Z) |
3396 GraphEntryInstr(*parsed_function_, normal_entry, Compiler::kNoOSRDeoptId); | 3415 GraphEntryInstr(*parsed_function_, normal_entry, osr_id_); |
3397 | 3416 |
3398 Fragment body(normal_entry); | 3417 Fragment body(normal_entry); |
3399 body += CheckStackOverflowInPrologue(); | 3418 body += CheckStackOverflowInPrologue(); |
3400 | 3419 |
3401 LocalScope* scope = parsed_function_->node_sequence()->scope(); | 3420 LocalScope* scope = parsed_function_->node_sequence()->scope(); |
3402 | 3421 |
3403 LocalVariable* closure = NULL; | 3422 LocalVariable* closure = NULL; |
3404 if (is_closure_call) { | 3423 if (is_closure_call) { |
3405 closure = scope->VariableAt(0); | 3424 closure = scope->VariableAt(0); |
3406 | 3425 |
(...skipping 21 matching lines...) Expand all Loading... | |
3428 body += LoadField(Closure::function_offset()); | 3447 body += LoadField(Closure::function_offset()); |
3429 | 3448 |
3430 body += ClosureCall(descriptor.Count(), argument_names); | 3449 body += ClosureCall(descriptor.Count(), argument_names); |
3431 } else { | 3450 } else { |
3432 body += InstanceCall(Symbols::Call(), Token::kILLEGAL, descriptor.Count(), | 3451 body += InstanceCall(Symbols::Call(), Token::kILLEGAL, descriptor.Count(), |
3433 argument_names); | 3452 argument_names); |
3434 } | 3453 } |
3435 | 3454 |
3436 body += Return(); | 3455 body += Return(); |
3437 | 3456 |
3457 PruneUnreachableIfOSR(); | |
3438 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); | 3458 return new (Z) FlowGraph(*parsed_function_, graph_entry_, next_block_id_ - 1); |
3439 } | 3459 } |
3440 | 3460 |
3441 | 3461 |
3442 void FlowGraphBuilder::SetupDefaultParameterValues(FunctionNode* function) { | 3462 void FlowGraphBuilder::SetupDefaultParameterValues(FunctionNode* function) { |
3443 intptr_t num_optional_parameters = | 3463 intptr_t num_optional_parameters = |
3444 parsed_function_->function().NumOptionalParameters(); | 3464 parsed_function_->function().NumOptionalParameters(); |
3445 if (num_optional_parameters > 0) { | 3465 if (num_optional_parameters > 0) { |
3446 ZoneGrowableArray<const Instance*>* default_values = | 3466 ZoneGrowableArray<const Instance*>* default_values = |
3447 new ZoneGrowableArray<const Instance*>(Z, num_optional_parameters); | 3467 new ZoneGrowableArray<const Instance*>(Z, num_optional_parameters); |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5569 instructions += LoadLocal(closure); | 5589 instructions += LoadLocal(closure); |
5570 instructions += LoadLocal(parsed_function_->current_context_var()); | 5590 instructions += LoadLocal(parsed_function_->current_context_var()); |
5571 instructions += StoreInstanceField(Closure::context_offset()); | 5591 instructions += StoreInstanceField(Closure::context_offset()); |
5572 | 5592 |
5573 return instructions; | 5593 return instructions; |
5574 } | 5594 } |
5575 | 5595 |
5576 | 5596 |
5577 } // namespace kernel | 5597 } // namespace kernel |
5578 } // namespace dart | 5598 } // namespace dart |
OLD | NEW |