OLD | NEW |
1 // Copyright 2012 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 |
(...skipping 13327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13338 int usage = static_cast<int>(isolate->heap()->SizeOfObjects()); | 13338 int usage = static_cast<int>(isolate->heap()->SizeOfObjects()); |
13339 if (!Smi::IsValid(usage)) { | 13339 if (!Smi::IsValid(usage)) { |
13340 return *isolate->factory()->NewNumberFromInt(usage); | 13340 return *isolate->factory()->NewNumberFromInt(usage); |
13341 } | 13341 } |
13342 return Smi::FromInt(usage); | 13342 return Smi::FromInt(usage); |
13343 } | 13343 } |
13344 | 13344 |
13345 #endif // ENABLE_DEBUGGER_SUPPORT | 13345 #endif // ENABLE_DEBUGGER_SUPPORT |
13346 | 13346 |
13347 | 13347 |
13348 RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerResume) { | |
13349 SealHandleScope shs(isolate); | |
13350 v8::V8::ResumeProfiler(); | |
13351 return isolate->heap()->undefined_value(); | |
13352 } | |
13353 | |
13354 | |
13355 RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerPause) { | |
13356 SealHandleScope shs(isolate); | |
13357 v8::V8::PauseProfiler(); | |
13358 return isolate->heap()->undefined_value(); | |
13359 } | |
13360 | |
13361 | |
13362 // Finds the script object from the script data. NOTE: This operation uses | 13348 // Finds the script object from the script data. NOTE: This operation uses |
13363 // heap traversal to find the function generated for the source position | 13349 // heap traversal to find the function generated for the source position |
13364 // for the requested break point. For lazily compiled functions several heap | 13350 // for the requested break point. For lazily compiled functions several heap |
13365 // traversals might be required rendering this operation as a rather slow | 13351 // traversals might be required rendering this operation as a rather slow |
13366 // operation. However for setting break points which is normally done through | 13352 // operation. However for setting break points which is normally done through |
13367 // some kind of user interaction the performance is not crucial. | 13353 // some kind of user interaction the performance is not crucial. |
13368 static Handle<Object> Runtime_GetScriptFromScriptName( | 13354 static Handle<Object> Runtime_GetScriptFromScriptName( |
13369 Handle<String> script_name) { | 13355 Handle<String> script_name) { |
13370 // Scan the heap for Script objects to find the script with the requested | 13356 // Scan the heap for Script objects to find the script with the requested |
13371 // script data. | 13357 // script data. |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13979 // Handle last resort GC and make sure to allow future allocations | 13965 // Handle last resort GC and make sure to allow future allocations |
13980 // to grow the heap without causing GCs (if possible). | 13966 // to grow the heap without causing GCs (if possible). |
13981 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13967 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13982 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13968 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13983 "Runtime::PerformGC"); | 13969 "Runtime::PerformGC"); |
13984 } | 13970 } |
13985 } | 13971 } |
13986 | 13972 |
13987 | 13973 |
13988 } } // namespace v8::internal | 13974 } } // namespace v8::internal |
OLD | NEW |