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

Side by Side Diff: src/execution.cc

Issue 9373028: Initial support for count-based profiling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution. 11 // with the distribution.
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 MaybeObject* Execution::HandleStackGuardInterrupt() { 875 MaybeObject* Execution::HandleStackGuardInterrupt() {
876 Isolate* isolate = Isolate::Current(); 876 Isolate* isolate = Isolate::Current();
877 StackGuard* stack_guard = isolate->stack_guard(); 877 StackGuard* stack_guard = isolate->stack_guard();
878 878
879 if (stack_guard->IsGCRequest()) { 879 if (stack_guard->IsGCRequest()) {
880 isolate->heap()->CollectAllGarbage(false, "StackGuard GC request"); 880 isolate->heap()->CollectAllGarbage(false, "StackGuard GC request");
881 stack_guard->Continue(GC_REQUEST); 881 stack_guard->Continue(GC_REQUEST);
882 } 882 }
883 883
884 isolate->counters()->stack_interrupts()->Increment(); 884 isolate->counters()->stack_interrupts()->Increment();
885 if (stack_guard->IsRuntimeProfilerTick()) { 885 // If FLAG_count_based_interrupts, every interrupt is a profiler interrupt.
886 if (FLAG_count_based_interrupts ||
887 stack_guard->IsRuntimeProfilerTick()) {
886 isolate->counters()->runtime_profiler_ticks()->Increment(); 888 isolate->counters()->runtime_profiler_ticks()->Increment();
887 stack_guard->Continue(RUNTIME_PROFILER_TICK); 889 stack_guard->Continue(RUNTIME_PROFILER_TICK);
888 isolate->runtime_profiler()->OptimizeNow(); 890 isolate->runtime_profiler()->OptimizeNow();
889 } 891 }
890 #ifdef ENABLE_DEBUGGER_SUPPORT 892 #ifdef ENABLE_DEBUGGER_SUPPORT
891 if (stack_guard->IsDebugBreak() || stack_guard->IsDebugCommand()) { 893 if (stack_guard->IsDebugBreak() || stack_guard->IsDebugCommand()) {
892 DebugBreakHelper(); 894 DebugBreakHelper();
893 } 895 }
894 #endif 896 #endif
895 if (stack_guard->IsPreempted()) RuntimePreempt(); 897 if (stack_guard->IsPreempted()) RuntimePreempt();
896 if (stack_guard->IsTerminateExecution()) { 898 if (stack_guard->IsTerminateExecution()) {
897 stack_guard->Continue(TERMINATE); 899 stack_guard->Continue(TERMINATE);
898 return isolate->TerminateExecution(); 900 return isolate->TerminateExecution();
899 } 901 }
900 if (stack_guard->IsInterrupted()) { 902 if (stack_guard->IsInterrupted()) {
901 stack_guard->Continue(INTERRUPT); 903 stack_guard->Continue(INTERRUPT);
902 return isolate->StackOverflow(); 904 return isolate->StackOverflow();
903 } 905 }
904 return isolate->heap()->undefined_value(); 906 return isolate->heap()->undefined_value();
905 } 907 }
906 908
909
907 } } // namespace v8::internal 910 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698