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 3110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3121 return free(buffer); | 3121 return free(buffer); |
3122 } | 3122 } |
3123 | 3123 |
3124 struct ValueSerializer::PrivateData { | 3124 struct ValueSerializer::PrivateData { |
3125 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate) | 3125 explicit PrivateData(i::Isolate* i, ValueSerializer::Delegate* delegate) |
3126 : isolate(i), serializer(i, delegate) {} | 3126 : isolate(i), serializer(i, delegate) {} |
3127 i::Isolate* isolate; | 3127 i::Isolate* isolate; |
3128 i::ValueSerializer serializer; | 3128 i::ValueSerializer serializer; |
3129 }; | 3129 }; |
3130 | 3130 |
3131 // static | |
3132 uint32_t ValueSerializer::GetCurrentDataFormatVersion() { | |
3133 return i::ValueSerializer::GetCurrentDataFormatVersion(); | |
3134 } | |
3135 | |
3136 ValueSerializer::ValueSerializer(Isolate* isolate) | 3131 ValueSerializer::ValueSerializer(Isolate* isolate) |
3137 : ValueSerializer(isolate, nullptr) {} | 3132 : ValueSerializer(isolate, nullptr) {} |
3138 | 3133 |
3139 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) | 3134 ValueSerializer::ValueSerializer(Isolate* isolate, Delegate* delegate) |
3140 : private_( | 3135 : private_( |
3141 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} | 3136 new PrivateData(reinterpret_cast<i::Isolate*>(isolate), delegate)) {} |
3142 | 3137 |
3143 ValueSerializer::~ValueSerializer() { delete private_; } | 3138 ValueSerializer::~ValueSerializer() { delete private_; } |
3144 | 3139 |
3145 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } | 3140 void ValueSerializer::WriteHeader() { private_->serializer.WriteHeader(); } |
(...skipping 7210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10356 Address callback_address = | 10351 Address callback_address = |
10357 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10352 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10358 VMState<EXTERNAL> state(isolate); | 10353 VMState<EXTERNAL> state(isolate); |
10359 ExternalCallbackScope call_scope(isolate, callback_address); | 10354 ExternalCallbackScope call_scope(isolate, callback_address); |
10360 callback(info); | 10355 callback(info); |
10361 } | 10356 } |
10362 | 10357 |
10363 | 10358 |
10364 } // namespace internal | 10359 } // namespace internal |
10365 } // namespace v8 | 10360 } // namespace v8 |
OLD | NEW |