OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 #include "accessors.h" | 10 #include "accessors.h" |
(...skipping 14860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14871 RUNTIME_ASSERT(!obj->IsJSGlobalProxy()); | 14871 RUNTIME_ASSERT(!obj->IsJSGlobalProxy()); |
14872 if (obj->IsJSProxy()) return isolate->heap()->undefined_value(); | 14872 if (obj->IsJSProxy()) return isolate->heap()->undefined_value(); |
14873 RUNTIME_ASSERT(!obj->map()->is_observed()); | 14873 RUNTIME_ASSERT(!obj->map()->is_observed()); |
14874 | 14874 |
14875 ASSERT(obj->IsJSObject()); | 14875 ASSERT(obj->IsJSObject()); |
14876 JSObject::SetObserved(Handle<JSObject>::cast(obj)); | 14876 JSObject::SetObserved(Handle<JSObject>::cast(obj)); |
14877 return isolate->heap()->undefined_value(); | 14877 return isolate->heap()->undefined_value(); |
14878 } | 14878 } |
14879 | 14879 |
14880 | 14880 |
14881 RUNTIME_FUNCTION(Runtime_SetMicrotaskPending) { | 14881 RUNTIME_FUNCTION(Runtime_EnqueueMicrotask) { |
14882 SealHandleScope shs(isolate); | 14882 HandleScope scope(isolate); |
14883 ASSERT(args.length() == 1); | 14883 ASSERT(args.length() == 1); |
14884 CONVERT_BOOLEAN_ARG_CHECKED(new_state, 0); | 14884 CONVERT_ARG_HANDLE_CHECKED(JSFunction, microtask, 0); |
14885 bool old_state = isolate->microtask_pending(); | 14885 isolate->EnqueueMicrotask(microtask); |
14886 isolate->set_microtask_pending(new_state); | 14886 return isolate->heap()->undefined_value(); |
14887 return isolate->heap()->ToBoolean(old_state); | |
14888 } | 14887 } |
14889 | 14888 |
14890 | 14889 |
14891 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 14890 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
14892 HandleScope scope(isolate); | 14891 HandleScope scope(isolate); |
14893 ASSERT(args.length() == 0); | 14892 ASSERT(args.length() == 0); |
14894 if (isolate->microtask_pending()) Execution::RunMicrotasks(isolate); | 14893 isolate->RunMicrotasks(); |
14895 return isolate->heap()->undefined_value(); | 14894 return isolate->heap()->undefined_value(); |
14896 } | 14895 } |
14897 | 14896 |
14898 | 14897 |
14899 RUNTIME_FUNCTION(Runtime_GetMicrotaskState) { | |
14900 SealHandleScope shs(isolate); | |
14901 ASSERT(args.length() == 0); | |
14902 return isolate->heap()->microtask_state(); | |
14903 } | |
14904 | |
14905 | |
14906 RUNTIME_FUNCTION(Runtime_GetObservationState) { | 14898 RUNTIME_FUNCTION(Runtime_GetObservationState) { |
14907 SealHandleScope shs(isolate); | 14899 SealHandleScope shs(isolate); |
14908 ASSERT(args.length() == 0); | 14900 ASSERT(args.length() == 0); |
14909 return isolate->heap()->observation_state(); | 14901 return isolate->heap()->observation_state(); |
14910 } | 14902 } |
14911 | 14903 |
14912 | 14904 |
14913 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { | 14905 RUNTIME_FUNCTION(Runtime_ObservationWeakMapCreate) { |
14914 HandleScope scope(isolate); | 14906 HandleScope scope(isolate); |
14915 ASSERT(args.length() == 0); | 14907 ASSERT(args.length() == 0); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15228 } | 15220 } |
15229 return NULL; | 15221 return NULL; |
15230 } | 15222 } |
15231 | 15223 |
15232 | 15224 |
15233 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15225 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15234 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15226 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15235 } | 15227 } |
15236 | 15228 |
15237 } } // namespace v8::internal | 15229 } } // namespace v8::internal |
OLD | NEW |