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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/runtime/runtime-utils.h" | 8 #include "src/runtime/runtime-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 | 46 |
47 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { | 47 RUNTIME_FUNCTION(Runtime_RunMicrotasks) { |
48 HandleScope scope(isolate); | 48 HandleScope scope(isolate); |
49 DCHECK(args.length() == 0); | 49 DCHECK(args.length() == 0); |
50 isolate->RunMicrotasks(); | 50 isolate->RunMicrotasks(); |
51 return isolate->heap()->undefined_value(); | 51 return isolate->heap()->undefined_value(); |
52 } | 52 } |
53 | 53 |
54 | 54 |
| 55 RUNTIME_FUNCTION(Runtime_DeliverObservationChangeRecords) { |
| 56 HandleScope scope(isolate); |
| 57 DCHECK(args.length() == 2); |
| 58 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0); |
| 59 CONVERT_ARG_HANDLE_CHECKED(Object, argument, 1); |
| 60 v8::TryCatch catcher; |
| 61 // We should send a message on uncaught exception thrown during |
| 62 // Object.observe delivery while not interrupting further delivery, thus |
| 63 // we make a call inside a verbose TryCatch. |
| 64 catcher.SetVerbose(true); |
| 65 Handle<Object> argv[] = {argument}; |
| 66 USE(Execution::Call(isolate, callback, isolate->factory()->undefined_value(), |
| 67 arraysize(argv), argv)); |
| 68 if (isolate->has_pending_exception()) { |
| 69 isolate->ReportPendingMessages(); |
| 70 isolate->clear_pending_exception(); |
| 71 isolate->set_external_caught_exception(false); |
| 72 } |
| 73 return isolate->heap()->undefined_value(); |
| 74 } |
| 75 |
| 76 |
55 RUNTIME_FUNCTION(Runtime_GetObservationState) { | 77 RUNTIME_FUNCTION(Runtime_GetObservationState) { |
56 SealHandleScope shs(isolate); | 78 SealHandleScope shs(isolate); |
57 DCHECK(args.length() == 0); | 79 DCHECK(args.length() == 0); |
58 return isolate->heap()->observation_state(); | 80 return isolate->heap()->observation_state(); |
59 } | 81 } |
60 | 82 |
61 | 83 |
62 static bool ContextsHaveSameOrigin(Handle<Context> context1, | 84 static bool ContextsHaveSameOrigin(Handle<Context> context1, |
63 Handle<Context> context2) { | 85 Handle<Context> context2) { |
64 return context1->security_token() == context2->security_token(); | 86 return context1->security_token() == context2->security_token(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 RUNTIME_FUNCTION(Runtime_GetObjectContextNotifierPerformChange) { | 138 RUNTIME_FUNCTION(Runtime_GetObjectContextNotifierPerformChange) { |
117 HandleScope scope(isolate); | 139 HandleScope scope(isolate); |
118 DCHECK(args.length() == 1); | 140 DCHECK(args.length() == 1); |
119 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0); | 141 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0); |
120 | 142 |
121 Handle<Context> context(object_info->GetCreationContext(), isolate); | 143 Handle<Context> context(object_info->GetCreationContext(), isolate); |
122 return context->native_object_notifier_perform_change(); | 144 return context->native_object_notifier_perform_change(); |
123 } | 145 } |
124 } | 146 } |
125 } // namespace v8::internal | 147 } // namespace v8::internal |
OLD | NEW |