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

Side by Side Diff: src/runtime.cc

Issue 450011: Add pause / resume profiling commands to debugger protocol. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « src/runtime.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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
(...skipping 7673 matching lines...) Expand 10 before | Expand all | Expand 10 after
7684 } 7684 }
7685 7685
7686 7686
7687 static Object* Runtime_FunctionGetInferredName(Arguments args) { 7687 static Object* Runtime_FunctionGetInferredName(Arguments args) {
7688 NoHandleAllocation ha; 7688 NoHandleAllocation ha;
7689 ASSERT(args.length() == 1); 7689 ASSERT(args.length() == 1);
7690 7690
7691 CONVERT_CHECKED(JSFunction, f, args[0]); 7691 CONVERT_CHECKED(JSFunction, f, args[0]);
7692 return f->shared()->inferred_name(); 7692 return f->shared()->inferred_name();
7693 } 7693 }
7694
7694 #endif // ENABLE_DEBUGGER_SUPPORT 7695 #endif // ENABLE_DEBUGGER_SUPPORT
7695 7696
7697 #ifdef ENABLE_LOGGING_AND_PROFILING
7698
7699 static Object* Runtime_ProfilerResume(Arguments args) {
7700 NoHandleAllocation ha;
7701 ASSERT(args.length() == 1);
7702
7703 CONVERT_CHECKED(Smi, smi_modules, args[0]);
7704 Logger::ResumeProfiler(smi_modules->value());
7705 return Heap::undefined_value();
7706 }
7707
7708
7709 static Object* Runtime_ProfilerPause(Arguments args) {
7710 NoHandleAllocation ha;
7711 ASSERT(args.length() == 1);
7712
7713 CONVERT_CHECKED(Smi, smi_modules, args[0]);
7714 Logger::PauseProfiler(smi_modules->value());
7715 return Heap::undefined_value();
7716 }
7717
7718 #endif // ENABLE_LOGGING_AND_PROFILING
7696 7719
7697 // Finds the script object from the script data. NOTE: This operation uses 7720 // Finds the script object from the script data. NOTE: This operation uses
7698 // heap traversal to find the function generated for the source position 7721 // heap traversal to find the function generated for the source position
7699 // for the requested break point. For lazily compiled functions several heap 7722 // for the requested break point. For lazily compiled functions several heap
7700 // traversals might be required rendering this operation as a rather slow 7723 // traversals might be required rendering this operation as a rather slow
7701 // operation. However for setting break points which is normally done through 7724 // operation. However for setting break points which is normally done through
7702 // some kind of user interaction the performance is not crucial. 7725 // some kind of user interaction the performance is not crucial.
7703 static Handle<Object> Runtime_GetScriptFromScriptName( 7726 static Handle<Object> Runtime_GetScriptFromScriptName(
7704 Handle<String> script_name) { 7727 Handle<String> script_name) {
7705 // Scan the heap for Script objects to find the script with the requested 7728 // Scan the heap for Script objects to find the script with the requested
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
7935 } else { 7958 } else {
7936 // Handle last resort GC and make sure to allow future allocations 7959 // Handle last resort GC and make sure to allow future allocations
7937 // to grow the heap without causing GCs (if possible). 7960 // to grow the heap without causing GCs (if possible).
7938 Counters::gc_last_resort_from_js.Increment(); 7961 Counters::gc_last_resort_from_js.Increment();
7939 Heap::CollectAllGarbage(false); 7962 Heap::CollectAllGarbage(false);
7940 } 7963 }
7941 } 7964 }
7942 7965
7943 7966
7944 } } // namespace v8::internal 7967 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698