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 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3138 return free(buffer); | 3138 return free(buffer); |
3139 } | 3139 } |
3140 | 3140 |
3141 struct ValueSerializer::PrivateData { | 3141 struct ValueSerializer::PrivateData { |
3142 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate) | 3142 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate) |
3143 : isolate(i), serializer(i, delegate) {} | 3143 : isolate(i), serializer(i, delegate) {} |
3144 i::Isolate* isolate; | 3144 i::Isolate* isolate; |
3145 i::ValueSerializer serializer; | 3145 i::ValueSerializer serializer; |
3146 }; | 3146 }; |
3147 | 3147 |
| 3148 // static |
| 3149 uint32_t ValueSerializer::GetCurrentDataFormatVersion() { |
| 3150 return i::ValueSerializer::GetCurrentDataFormatVersion(); |
| 3151 } |
| 3152 |
3148 ValueSerializer::ValueSerializer(Isolate* isolate) | 3153 ValueSerializer::ValueSerializer(Isolate* isolate) |
3149 : ValueSerializer(isolate, nullptr) {} | 3154 : ValueSerializer(isolate, nullptr) {} |
3150 | 3155 |
3151 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) | 3156 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) |
3152 : private_( | 3157 : private_( |
3153 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} | 3158 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} |
3154 | 3159 |
3155 ValueSerializer::~ValueSerializer() { delete private_; } | 3160 ValueSerializer::~ValueSerializer() { delete private_; } |
3156 | 3161 |
3157 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } | 3162 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } |
(...skipping 7158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10316 Address callback_address = | 10321 Address callback_address = |
10317 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10322 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10318 VMState<EXTERNAL> state(isolate); | 10323 VMState<EXTERNAL> state(isolate); |
10319 ExternalCallbackScope call_scope(isolate, callback_address); | 10324 ExternalCallbackScope call_scope(isolate, callback_address); |
10320 callback(info); | 10325 callback(info); |
10321 } | 10326 } |
10322 | 10327 |
10323 | 10328 |
10324 } // namespace internal | 10329 } // namespace internal |
10325 } // namespace v8 | 10330 } // namespace v8 |
OLD | NEW |