Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: runtime/vm/clustered_snapshot.cc

Issue 2683633005: Add exception handler cache to isolate (Closed)
Patch Set: Address review commments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | runtime/vm/fixed_cache.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1975 1975
1976 void WriteFill(Serializer* s) { 1976 void WriteFill(Serializer* s) {
1977 intptr_t count = objects_.length(); 1977 intptr_t count = objects_.length();
1978 for (intptr_t i = 0; i < count; i++) { 1978 for (intptr_t i = 0; i < count; i++) {
1979 RawExceptionHandlers* handlers = objects_[i]; 1979 RawExceptionHandlers* handlers = objects_[i];
1980 intptr_t length = handlers->ptr()->num_entries_; 1980 intptr_t length = handlers->ptr()->num_entries_;
1981 s->Write<int32_t>(length); 1981 s->Write<int32_t>(length);
1982 s->WriteRef(handlers->ptr()->handled_types_data_); 1982 s->WriteRef(handlers->ptr()->handled_types_data_);
1983 1983
1984 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); 1984 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data());
1985 intptr_t length_in_bytes = 1985 intptr_t length_in_bytes = length * sizeof(HandlerInfo);
1986 length * sizeof(RawExceptionHandlers::HandlerInfo);
1987 s->WriteBytes(data, length_in_bytes); 1986 s->WriteBytes(data, length_in_bytes);
1988 } 1987 }
1989 } 1988 }
1990 1989
1991 private: 1990 private:
1992 GrowableArray<RawExceptionHandlers*> objects_; 1991 GrowableArray<RawExceptionHandlers*> objects_;
1993 }; 1992 };
1994 #endif // !DART_PRECOMPILED_RUNTIME 1993 #endif // !DART_PRECOMPILED_RUNTIME
1995 1994
1996 1995
(...skipping 22 matching lines...) Expand all
2019 reinterpret_cast<RawExceptionHandlers*>(d->Ref(id)); 2018 reinterpret_cast<RawExceptionHandlers*>(d->Ref(id));
2020 intptr_t length = d->Read<int32_t>(); 2019 intptr_t length = d->Read<int32_t>();
2021 Deserializer::InitializeHeader(handlers, kExceptionHandlersCid, 2020 Deserializer::InitializeHeader(handlers, kExceptionHandlersCid,
2022 ExceptionHandlers::InstanceSize(length), 2021 ExceptionHandlers::InstanceSize(length),
2023 is_vm_object); 2022 is_vm_object);
2024 handlers->ptr()->num_entries_ = length; 2023 handlers->ptr()->num_entries_ = length;
2025 handlers->ptr()->handled_types_data_ = 2024 handlers->ptr()->handled_types_data_ =
2026 reinterpret_cast<RawArray*>(d->ReadRef()); 2025 reinterpret_cast<RawArray*>(d->ReadRef());
2027 2026
2028 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); 2027 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data());
2029 intptr_t length_in_bytes = 2028 intptr_t length_in_bytes = length * sizeof(HandlerInfo);
2030 length * sizeof(RawExceptionHandlers::HandlerInfo);
2031 d->ReadBytes(data, length_in_bytes); 2029 d->ReadBytes(data, length_in_bytes);
2032 } 2030 }
2033 } 2031 }
2034 }; 2032 };
2035 2033
2036 #if !defined(DART_PRECOMPILED_RUNTIME) 2034 #if !defined(DART_PRECOMPILED_RUNTIME)
2037 class ContextSerializationCluster : public SerializationCluster { 2035 class ContextSerializationCluster : public SerializationCluster {
2038 public: 2036 public:
2039 ContextSerializationCluster() {} 2037 ContextSerializationCluster() {}
2040 virtual ~ContextSerializationCluster() {} 2038 virtual ~ContextSerializationCluster() {}
(...skipping 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after
5510 thread_->isolate()->SetupImagePage(data_buffer_, 5508 thread_->isolate()->SetupImagePage(data_buffer_,
5511 /* is_executable */ false); 5509 /* is_executable */ false);
5512 } 5510 }
5513 5511
5514 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5512 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5515 5513
5516 return ApiError::null(); 5514 return ApiError::null();
5517 } 5515 }
5518 5516
5519 } // namespace dart 5517 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | runtime/vm/fixed_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698