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

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

Issue 2683633005: Add exception handler cache to isolate (Closed)
Patch Set: s/HandlerInfo/ExceptionHandlerInfo 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') | no next file with comments »
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 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 1978
1979 void WriteFill(Serializer* s) { 1979 void WriteFill(Serializer* s) {
1980 intptr_t count = objects_.length(); 1980 intptr_t count = objects_.length();
1981 for (intptr_t i = 0; i < count; i++) { 1981 for (intptr_t i = 0; i < count; i++) {
1982 RawExceptionHandlers* handlers = objects_[i]; 1982 RawExceptionHandlers* handlers = objects_[i];
1983 intptr_t length = handlers->ptr()->num_entries_; 1983 intptr_t length = handlers->ptr()->num_entries_;
1984 s->Write<int32_t>(length); 1984 s->Write<int32_t>(length);
1985 s->WriteRef(handlers->ptr()->handled_types_data_); 1985 s->WriteRef(handlers->ptr()->handled_types_data_);
1986 1986
1987 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); 1987 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data());
1988 intptr_t length_in_bytes = 1988 intptr_t length_in_bytes = length * sizeof(ExceptionHandlerInfo);
1989 length * sizeof(RawExceptionHandlers::HandlerInfo);
1990 s->WriteBytes(data, length_in_bytes); 1989 s->WriteBytes(data, length_in_bytes);
1991 } 1990 }
1992 } 1991 }
1993 1992
1994 private: 1993 private:
1995 GrowableArray<RawExceptionHandlers*> objects_; 1994 GrowableArray<RawExceptionHandlers*> objects_;
1996 }; 1995 };
1997 #endif // !DART_PRECOMPILED_RUNTIME 1996 #endif // !DART_PRECOMPILED_RUNTIME
1998 1997
1999 1998
(...skipping 22 matching lines...) Expand all
2022 reinterpret_cast<RawExceptionHandlers*>(d->Ref(id)); 2021 reinterpret_cast<RawExceptionHandlers*>(d->Ref(id));
2023 intptr_t length = d->Read<int32_t>(); 2022 intptr_t length = d->Read<int32_t>();
2024 Deserializer::InitializeHeader(handlers, kExceptionHandlersCid, 2023 Deserializer::InitializeHeader(handlers, kExceptionHandlersCid,
2025 ExceptionHandlers::InstanceSize(length), 2024 ExceptionHandlers::InstanceSize(length),
2026 is_vm_object); 2025 is_vm_object);
2027 handlers->ptr()->num_entries_ = length; 2026 handlers->ptr()->num_entries_ = length;
2028 handlers->ptr()->handled_types_data_ = 2027 handlers->ptr()->handled_types_data_ =
2029 reinterpret_cast<RawArray*>(d->ReadRef()); 2028 reinterpret_cast<RawArray*>(d->ReadRef());
2030 2029
2031 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); 2030 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data());
2032 intptr_t length_in_bytes = 2031 intptr_t length_in_bytes = length * sizeof(ExceptionHandlerInfo);
2033 length * sizeof(RawExceptionHandlers::HandlerInfo);
2034 d->ReadBytes(data, length_in_bytes); 2032 d->ReadBytes(data, length_in_bytes);
2035 } 2033 }
2036 } 2034 }
2037 }; 2035 };
2038 2036
2039 #if !defined(DART_PRECOMPILED_RUNTIME) 2037 #if !defined(DART_PRECOMPILED_RUNTIME)
2040 class ContextSerializationCluster : public SerializationCluster { 2038 class ContextSerializationCluster : public SerializationCluster {
2041 public: 2039 public:
2042 ContextSerializationCluster() {} 2040 ContextSerializationCluster() {}
2043 virtual ~ContextSerializationCluster() {} 2041 virtual ~ContextSerializationCluster() {}
(...skipping 3472 matching lines...) Expand 10 before | Expand all | Expand 10 after
5516 thread_->isolate()->SetupImagePage(data_buffer_, 5514 thread_->isolate()->SetupImagePage(data_buffer_,
5517 /* is_executable */ false); 5515 /* is_executable */ false);
5518 } 5516 }
5519 5517
5520 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5518 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5521 5519
5522 return ApiError::null(); 5520 return ApiError::null();
5523 } 5521 }
5524 5522
5525 } // namespace dart 5523 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698