OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/debug/debug-evaluate.h" | 8 #include "src/debug/debug-evaluate.h" |
9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
10 #include "src/debug/debug-scopes.h" | 10 #include "src/debug/debug-scopes.h" |
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1515 context->set_security_token(isolate->native_context()->security_token()); | 1515 context->set_security_token(isolate->native_context()->security_token()); |
1516 return context->global_proxy(); | 1516 return context->global_proxy(); |
1517 } | 1517 } |
1518 | 1518 |
1519 | 1519 |
1520 // Performs a GC. | 1520 // Performs a GC. |
1521 // Presently, it only does a full GC. | 1521 // Presently, it only does a full GC. |
1522 RUNTIME_FUNCTION(Runtime_CollectGarbage) { | 1522 RUNTIME_FUNCTION(Runtime_CollectGarbage) { |
1523 SealHandleScope shs(isolate); | 1523 SealHandleScope shs(isolate); |
1524 DCHECK(args.length() == 1); | 1524 DCHECK(args.length() == 1); |
1525 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "%CollectGarbage"); | 1525 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 1526 GarbageCollectionReason::kRuntime); |
1526 return isolate->heap()->undefined_value(); | 1527 return isolate->heap()->undefined_value(); |
1527 } | 1528 } |
1528 | 1529 |
1529 | 1530 |
1530 // Gets the current heap usage. | 1531 // Gets the current heap usage. |
1531 RUNTIME_FUNCTION(Runtime_GetHeapUsage) { | 1532 RUNTIME_FUNCTION(Runtime_GetHeapUsage) { |
1532 SealHandleScope shs(isolate); | 1533 SealHandleScope shs(isolate); |
1533 DCHECK(args.length() == 0); | 1534 DCHECK(args.length() == 0); |
1534 int usage = static_cast<int>(isolate->heap()->SizeOfObjects()); | 1535 int usage = static_cast<int>(isolate->heap()->SizeOfObjects()); |
1535 if (!Smi::IsValid(usage)) { | 1536 if (!Smi::IsValid(usage)) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); | 1867 Handle<Script> script = Handle<Script>(Script::cast(script_val->value())); |
1867 | 1868 |
1868 Handle<wasm::WasmDebugInfo> debug_info = | 1869 Handle<wasm::WasmDebugInfo> debug_info = |
1869 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); | 1870 wasm::GetDebugInfo(handle(script->wasm_object(), isolate)); |
1870 return *wasm::WasmDebugInfo::DisassembleFunction( | 1871 return *wasm::WasmDebugInfo::DisassembleFunction( |
1871 debug_info, script->wasm_function_index()); | 1872 debug_info, script->wasm_function_index()); |
1872 } | 1873 } |
1873 | 1874 |
1874 } // namespace internal | 1875 } // namespace internal |
1875 } // namespace v8 | 1876 } // namespace v8 |
OLD | NEW |