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

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

Issue 8823001: Use preallocated StackOverflowException (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 ASSERT(arguments.Count() == 822 ASSERT(arguments.Count() ==
823 kClosureArgumentMismatchRuntimeEntry.argument_count()); 823 kClosureArgumentMismatchRuntimeEntry.argument_count());
824 GrowableArray<const Object*> args; 824 GrowableArray<const Object*> args;
825 Exceptions::ThrowByType(Exceptions::kClosureArgumentMismatch, args); 825 Exceptions::ThrowByType(Exceptions::kClosureArgumentMismatch, args);
826 } 826 }
827 827
828 828
829 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { 829 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
830 ASSERT(arguments.Count() == 830 ASSERT(arguments.Count() ==
831 kStackOverflowRuntimeEntry.argument_count()); 831 kStackOverflowRuntimeEntry.argument_count());
832 uword old_stack_limit = isolate->stack_limit(); 832 // Use a preallocated stack overflow exception to avoid calling into
833 isolate->AdjustStackLimitForException(); 833 // dart code.
834 // Recursive stack overflow check. 834 const Instance& exception =
835 ASSERT(old_stack_limit != isolate->stack_limit()); 835 Instance::Handle(isolate->object_store()->stack_overflow());
836 GrowableArray<const Object*> args; 836 Exceptions::Throw(exception);
837 Exceptions::ThrowByType(Exceptions::kStackOverflow, args); 837 UNREACHABLE();
838 isolate->ResetStackLimitAfterException();
839 } 838 }
840 839
841 840
842 // Only unoptimized code has invocation counter threshold checking. 841 // Only unoptimized code has invocation counter threshold checking.
843 // Once the invocation counter threshold is reached any entry into the 842 // Once the invocation counter threshold is reached any entry into the
844 // unoptimized code is redirected to this function. 843 // unoptimized code is redirected to this function.
845 DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) { 844 DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
846 ASSERT(arguments.Count() == 845 ASSERT(arguments.Count() ==
847 kOptimizeInvokedFunctionRuntimeEntry.argument_count()); 846 kOptimizeInvokedFunctionRuntimeEntry.argument_count());
848 const Function& function = Function::CheckedHandle(arguments.At(0)); 847 const Function& function = Function::CheckedHandle(arguments.At(0));
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1046 }
1048 } 1047 }
1049 } 1048 }
1050 // The cache is null terminated, therefore the loop above should never 1049 // The cache is null terminated, therefore the loop above should never
1051 // terminate by itself. 1050 // terminate by itself.
1052 UNREACHABLE(); 1051 UNREACHABLE();
1053 return Code::null(); 1052 return Code::null();
1054 } 1053 }
1055 1054
1056 } // namespace dart 1055 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698