| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) { | 893 EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) { |
| 894 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 894 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 895 escape_slot_ = CreateHandle(isolate, isolate->heap()->the_hole_value()); | 895 escape_slot_ = CreateHandle(isolate, isolate->heap()->the_hole_value()); |
| 896 Initialize(v8_isolate); | 896 Initialize(v8_isolate); |
| 897 } | 897 } |
| 898 | 898 |
| 899 | 899 |
| 900 i::Object** EscapableHandleScope::Escape(i::Object** escape_value) { | 900 i::Object** EscapableHandleScope::Escape(i::Object** escape_value) { |
| 901 i::Heap* heap = reinterpret_cast<i::Isolate*>(GetIsolate())->heap(); | 901 i::Heap* heap = reinterpret_cast<i::Isolate*>(GetIsolate())->heap(); |
| 902 Utils::ApiCheck((*escape_slot_)->IsTheHole(heap->isolate()), | 902 Utils::ApiCheck((*escape_slot_)->IsTheHole(heap->isolate()), |
| 903 "EscapeableHandleScope::Escape", "Escape value set twice"); | 903 "EscapableHandleScope::Escape", "Escape value set twice"); |
| 904 if (escape_value == NULL) { | 904 if (escape_value == NULL) { |
| 905 *escape_slot_ = heap->undefined_value(); | 905 *escape_slot_ = heap->undefined_value(); |
| 906 return NULL; | 906 return NULL; |
| 907 } | 907 } |
| 908 *escape_slot_ = *escape_value; | 908 *escape_slot_ = *escape_value; |
| 909 return escape_slot_; | 909 return escape_slot_; |
| 910 } | 910 } |
| 911 | 911 |
| 912 | 912 |
| 913 SealHandleScope::SealHandleScope(Isolate* isolate) { | 913 SealHandleScope::SealHandleScope(Isolate* isolate) { |
| (...skipping 8124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9038 Address callback_address = | 9038 Address callback_address = |
| 9039 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9039 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9040 VMState<EXTERNAL> state(isolate); | 9040 VMState<EXTERNAL> state(isolate); |
| 9041 ExternalCallbackScope call_scope(isolate, callback_address); | 9041 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9042 callback(info); | 9042 callback(info); |
| 9043 } | 9043 } |
| 9044 | 9044 |
| 9045 | 9045 |
| 9046 } // namespace internal | 9046 } // namespace internal |
| 9047 } // namespace v8 | 9047 } // namespace v8 |
| OLD | NEW |