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

Side by Side Diff: src/runtime.cc

Issue 154283002: V8 Microtask Queue & API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: pre-review Created 6 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
OLDNEW
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 14582 matching lines...) Expand 10 before | Expand all | Expand 10 after
14593 14593
14594 14594
14595 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunMicrotasks) { 14595 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunMicrotasks) {
14596 HandleScope scope(isolate); 14596 HandleScope scope(isolate);
14597 ASSERT(args.length() == 0); 14597 ASSERT(args.length() == 0);
14598 Execution::RunMicrotasks(isolate); 14598 Execution::RunMicrotasks(isolate);
14599 return isolate->heap()->undefined_value(); 14599 return isolate->heap()->undefined_value();
14600 } 14600 }
14601 14601
14602 14602
14603 RUNTIME_FUNCTION(MaybeObject*, Runtime_RunExternalMicrotask) {
14604 SealHandleScope shs(isolate);
14605 ASSERT(args.length() == 1);
14606 CONVERT_ARG_CHECKED(Object, handler, 0);
14607 v8::MicrotaskCallback callback = v8::ToCData<v8::MicrotaskCallback>(handler);
14608 {
14609 VMState<EXTERNAL> state(isolate);
14610 callback();
14611 }
14612 return isolate->heap()->undefined_value();
14613 }
14614
14615
14603 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) { 14616 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) {
14604 SealHandleScope shs(isolate); 14617 SealHandleScope shs(isolate);
14605 ASSERT(args.length() == 0); 14618 ASSERT(args.length() == 0);
14606 return isolate->heap()->observation_state(); 14619 return isolate->heap()->observation_state();
14607 } 14620 }
14608 14621
14609 14622
14610 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObservationWeakMapCreate) { 14623 RUNTIME_FUNCTION(MaybeObject*, Runtime_ObservationWeakMapCreate) {
14611 HandleScope scope(isolate); 14624 HandleScope scope(isolate);
14612 ASSERT(args.length() == 0); 14625 ASSERT(args.length() == 0);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
14868 // Handle last resort GC and make sure to allow future allocations 14881 // Handle last resort GC and make sure to allow future allocations
14869 // to grow the heap without causing GCs (if possible). 14882 // to grow the heap without causing GCs (if possible).
14870 isolate->counters()->gc_last_resort_from_js()->Increment(); 14883 isolate->counters()->gc_last_resort_from_js()->Increment();
14871 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14884 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14872 "Runtime::PerformGC"); 14885 "Runtime::PerformGC");
14873 } 14886 }
14874 } 14887 }
14875 14888
14876 14889
14877 } } // namespace v8::internal 14890 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698