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

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

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 | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 12675 matching lines...) Expand 10 before | Expand all | Expand 10 after
12686 space); 12686 space);
12687 NoGCScope no_gc; 12687 NoGCScope no_gc;
12688 result ^= raw; 12688 result ^= raw;
12689 } 12689 }
12690 result.set_exception(exception); 12690 result.set_exception(exception);
12691 result.set_stacktrace(stacktrace); 12691 result.set_stacktrace(stacktrace);
12692 return result.raw(); 12692 return result.raw();
12693 } 12693 }
12694 12694
12695 12695
12696 RawUnhandledException* UnhandledException::New(Heap::Space space) {
12697 ASSERT(Object::unhandled_exception_class() != Class::null());
12698 UnhandledException& result = UnhandledException::Handle();
12699 {
12700 RawObject* raw = Object::Allocate(UnhandledException::kClassId,
12701 UnhandledException::InstanceSize(),
12702 space);
12703 NoGCScope no_gc;
12704 result ^= raw;
12705 }
12706 result.set_exception(Object::null_instance());
12707 result.set_stacktrace(Object::null_instance());
12708 return result.raw();
12709 }
12710
12711
12696 void UnhandledException::set_exception(const Instance& exception) const { 12712 void UnhandledException::set_exception(const Instance& exception) const {
12697 StorePointer(&raw_ptr()->exception_, exception.raw()); 12713 StorePointer(&raw_ptr()->exception_, exception.raw());
12698 } 12714 }
12699 12715
12700 12716
12701 void UnhandledException::set_stacktrace(const Instance& stacktrace) const { 12717 void UnhandledException::set_stacktrace(const Instance& stacktrace) const {
12702 StorePointer(&raw_ptr()->stacktrace_, stacktrace.raw()); 12718 StorePointer(&raw_ptr()->stacktrace_, stacktrace.raw());
12703 } 12719 }
12704 12720
12705 12721
(...skipping 6375 matching lines...) Expand 10 before | Expand all | Expand 10 after
19081 return tag_label.ToCString(); 19097 return tag_label.ToCString();
19082 } 19098 }
19083 19099
19084 19100
19085 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19101 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19086 Instance::PrintJSONImpl(stream, ref); 19102 Instance::PrintJSONImpl(stream, ref);
19087 } 19103 }
19088 19104
19089 19105
19090 } // namespace dart 19106 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698