| 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 "src/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 EXCEPTION_BAILOUT_CHECK_GENERIC( \ | 91 EXCEPTION_BAILOUT_CHECK_GENERIC( \ |
| 92 isolate, value, isolate->FireCallCompletedCallback();) | 92 isolate, value, isolate->FireCallCompletedCallback();) |
| 93 | 93 |
| 94 | 94 |
| 95 #define EXCEPTION_BAILOUT_CHECK(isolate, value) \ | 95 #define EXCEPTION_BAILOUT_CHECK(isolate, value) \ |
| 96 EXCEPTION_BAILOUT_CHECK_GENERIC(isolate, value, ;) | 96 EXCEPTION_BAILOUT_CHECK_GENERIC(isolate, value, ;) |
| 97 | 97 |
| 98 | 98 |
| 99 #define PREPARE_FOR_EXECUTION_GENERIC(context, function_name, bailout_value, \ | 99 #define PREPARE_FOR_EXECUTION_GENERIC(context, function_name, bailout_value, \ |
| 100 HandleScopeClass) \ | 100 HandleScopeClass) \ |
| 101 auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate()); \ | 101 auto isolate = context.IsEmpty() \ |
| 102 ? i::Isolate::Current() \ |
| 103 : reinterpret_cast<i::Isolate*>(context->GetIsolate()); \ |
| 102 if (IsExecutionTerminatingCheck(isolate)) { \ | 104 if (IsExecutionTerminatingCheck(isolate)) { \ |
| 103 return bailout_value; \ | 105 return bailout_value; \ |
| 104 } \ | 106 } \ |
| 105 HandleScopeClass handle_scope(isolate); \ | 107 HandleScopeClass handle_scope(isolate); \ |
| 106 CallDepthScope call_depth_scope(isolate, context, false); \ | 108 CallDepthScope call_depth_scope(isolate, context, false); \ |
| 107 LOG_API(isolate, function_name); \ | 109 LOG_API(isolate, function_name); \ |
| 108 ENTER_V8(isolate); \ | 110 ENTER_V8(isolate); \ |
| 109 bool has_pending_exception = false | 111 bool has_pending_exception = false |
| 110 | 112 |
| 111 | 113 |
| (...skipping 7862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7974 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7976 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7975 Address callback_address = | 7977 Address callback_address = |
| 7976 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7978 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7977 VMState<EXTERNAL> state(isolate); | 7979 VMState<EXTERNAL> state(isolate); |
| 7978 ExternalCallbackScope call_scope(isolate, callback_address); | 7980 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7979 callback(info); | 7981 callback(info); |
| 7980 } | 7982 } |
| 7981 | 7983 |
| 7982 | 7984 |
| 7983 } } // namespace v8::internal | 7985 } } // namespace v8::internal |
| OLD | NEW |