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

Side by Side Diff: runtime/vm/flow_graph_builder.cc

Issue 3002833003: Adjust the column number where a StackOverflow error is reported. (Closed)
Patch Set: fix typos Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/flow_graph_builder_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #if !defined(DART_PRECOMPILED_RUNTIME) 5 #if !defined(DART_PRECOMPILED_RUNTIME)
6 6
7 #include "vm/flow_graph_builder.h" 7 #include "vm/flow_graph_builder.h"
8 8
9 #include "lib/invocation_mirror.h" 9 #include "lib/invocation_mirror.h"
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 3863 matching lines...) Expand 10 before | Expand all | Expand 10 after
3874 } 3874 }
3875 #endif 3875 #endif
3876 3876
3877 // This check may be deleted if the generated code is leaf. 3877 // This check may be deleted if the generated code is leaf.
3878 // Native functions don't need a stack check at entry. 3878 // Native functions don't need a stack check at entry.
3879 if (is_top_level_sequence && !function.is_native()) { 3879 if (is_top_level_sequence && !function.is_native()) {
3880 // Always allocate CheckOverflowInstr so that deopt-ids match regardless 3880 // Always allocate CheckOverflowInstr so that deopt-ids match regardless
3881 // if we inline or not. 3881 // if we inline or not.
3882 if (!function.IsImplicitGetterFunction() && 3882 if (!function.IsImplicitGetterFunction() &&
3883 !function.IsImplicitSetterFunction()) { 3883 !function.IsImplicitSetterFunction()) {
3884 // We want the stack overlow error to be reported at the opening '{' or
3885 // at the '=>' location. So, we get the sequence node corresponding to the
3886 // body inside |node| and use its token position.
3887 ASSERT(node->length() > 0);
3884 CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr( 3888 CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr(
3885 node->token_pos(), 0, owner()->GetNextDeoptId()); 3889 node->NodeAt(0)->token_pos(), 0, owner()->GetNextDeoptId());
3886 // If we are inlining don't actually attach the stack check. We must still 3890 // If we are inlining don't actually attach the stack check. We must still
3887 // create the stack check in order to allocate a deopt id. 3891 // create the stack check in order to allocate a deopt id.
3888 if (!owner()->IsInlining()) { 3892 if (!owner()->IsInlining()) {
3889 AddInstruction(check); 3893 AddInstruction(check);
3890 } 3894 }
3891 } 3895 }
3892 } 3896 }
3893 3897
3894 if (Isolate::Current()->type_checks() && is_top_level_sequence) { 3898 if (Isolate::Current()->type_checks() && is_top_level_sequence) {
3895 const int num_params = function.NumParameters(); 3899 const int num_params = function.NumParameters();
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
4417 // Bail if the type has any type parameters. 4421 // Bail if the type has any type parameters.
4418 if (type_class.IsGeneric()) return false; 4422 if (type_class.IsGeneric()) return false;
4419 4423
4420 // Finally a simple class for instance of checking. 4424 // Finally a simple class for instance of checking.
4421 return true; 4425 return true;
4422 } 4426 }
4423 4427
4424 } // namespace dart 4428 } // namespace dart
4425 4429
4426 #endif // !defined(DART_PRECOMPILED_RUNTIME) 4430 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/flow_graph_builder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698