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

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

Issue 48833004: Modifies assertion for possibly null code pointer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/deopt_instructions.cc ('k') | runtime/vm/pages.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 #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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 void Function::DetachCode() const { 4044 void Function::DetachCode() const {
4045 // Set unoptimized code as non-entrant, and set code and unoptimized code 4045 // Set unoptimized code as non-entrant, and set code and unoptimized code
4046 // to null. 4046 // to null.
4047 CodePatcher::PatchEntry(Code::Handle(unoptimized_code())); 4047 CodePatcher::PatchEntry(Code::Handle(unoptimized_code()));
4048 StorePointer(&raw_ptr()->code_, Code::null()); 4048 StorePointer(&raw_ptr()->code_, Code::null());
4049 StorePointer(&raw_ptr()->unoptimized_code_, Code::null()); 4049 StorePointer(&raw_ptr()->unoptimized_code_, Code::null());
4050 } 4050 }
4051 4051
4052 4052
4053 void Function::ReattachCode(const Code& code) const { 4053 void Function::ReattachCode(const Code& code) const {
4054 set_unoptimized_code(code); 4054 StorePointer(&raw_ptr()->code_, code.raw());
4055 SetCode(code); 4055 StorePointer(&raw_ptr()->unoptimized_code_, code.raw());
4056 CodePatcher::RestoreEntry(code); 4056 CodePatcher::RestoreEntry(code);
4057 } 4057 }
4058 4058
4059 4059
4060 void Function::SwitchToUnoptimizedCode() const { 4060 void Function::SwitchToUnoptimizedCode() const {
4061 ASSERT(HasOptimizedCode()); 4061 ASSERT(HasOptimizedCode());
4062 4062
4063 const Code& current_code = Code::Handle(CurrentCode()); 4063 const Code& current_code = Code::Handle(CurrentCode());
4064 4064
4065 // Optimized code object might have been actually fully produced by the 4065 // Optimized code object might have been actually fully produced by the
(...skipping 11522 matching lines...) Expand 10 before | Expand all | Expand 10 after
15588 return "_MirrorReference"; 15588 return "_MirrorReference";
15589 } 15589 }
15590 15590
15591 15591
15592 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 15592 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
15593 JSONObject jsobj(stream); 15593 JSONObject jsobj(stream);
15594 } 15594 }
15595 15595
15596 15596
15597 } // namespace dart 15597 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698