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

Side by Side Diff: runtime/vm/object.h

Issue 388963003: Avoid allocating an exception object in the snapshot reader. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 4153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4164 return RoundedAllocationSize(sizeof(RawUnhandledException)); 4164 return RoundedAllocationSize(sizeof(RawUnhandledException));
4165 } 4165 }
4166 4166
4167 static RawUnhandledException* New(const Instance& exception, 4167 static RawUnhandledException* New(const Instance& exception,
4168 const Instance& stacktrace, 4168 const Instance& stacktrace,
4169 Heap::Space space = Heap::kNew); 4169 Heap::Space space = Heap::kNew);
4170 4170
4171 virtual const char* ToErrorCString() const; 4171 virtual const char* ToErrorCString() const;
4172 4172
4173 private: 4173 private:
4174 static RawUnhandledException* New(Heap::Space space = Heap::kNew);
4175
4174 void set_exception(const Instance& exception) const; 4176 void set_exception(const Instance& exception) const;
4175 void set_stacktrace(const Instance& stacktrace) const; 4177 void set_stacktrace(const Instance& stacktrace) const;
4176 4178
4177 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnhandledException, Error); 4179 FINAL_HEAP_OBJECT_IMPLEMENTATION(UnhandledException, Error);
4178 friend class Class; 4180 friend class Class;
4181 friend class ObjectStore;
4179 }; 4182 };
4180 4183
4181 4184
4182 class UnwindError : public Error { 4185 class UnwindError : public Error {
4183 public: 4186 public:
4184 RawString* message() const { return raw_ptr()->message_; } 4187 RawString* message() const { return raw_ptr()->message_; }
4185 4188
4186 static intptr_t InstanceSize() { 4189 static intptr_t InstanceSize() {
4187 return RoundedAllocationSize(sizeof(RawUnwindError)); 4190 return RoundedAllocationSize(sizeof(RawUnwindError));
4188 } 4191 }
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 7180
7178 7181
7179 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7182 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7180 intptr_t index) { 7183 intptr_t index) {
7181 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7184 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7182 } 7185 }
7183 7186
7184 } // namespace dart 7187 } // namespace dart
7185 7188
7186 #endif // VM_OBJECT_H_ 7189 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698