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

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

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
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 4012 matching lines...) Expand 10 before | Expand all | Expand 10 after
4023 4023
4024 4024
4025 void Function::SetCode(const Code& value) const { 4025 void Function::SetCode(const Code& value) const {
4026 StorePointer(&raw_ptr()->code_, value.raw()); 4026 StorePointer(&raw_ptr()->code_, value.raw());
4027 ASSERT(Function::Handle(value.function()).IsNull() || 4027 ASSERT(Function::Handle(value.function()).IsNull() ||
4028 (value.function() == this->raw())); 4028 (value.function() == this->raw()));
4029 value.set_function(*this); 4029 value.set_function(*this);
4030 } 4030 }
4031 4031
4032 4032
4033 void Function::DetachCode() const {
4034 StorePointer(&raw_ptr()->code_, Code::null());
4035 }
4036
4037
4033 void Function::SwitchToUnoptimizedCode() const { 4038 void Function::SwitchToUnoptimizedCode() const {
4034 ASSERT(HasOptimizedCode()); 4039 ASSERT(HasOptimizedCode());
4035 4040
4036 const Code& current_code = Code::Handle(CurrentCode()); 4041 const Code& current_code = Code::Handle(CurrentCode());
4037 4042
4038 // Optimized code object might have been actually fully produced by the 4043 // Optimized code object might have been actually fully produced by the
4039 // intrinsifier in this case nothing has to be done. In fact an attempt to 4044 // intrinsifier in this case nothing has to be done. In fact an attempt to
4040 // patch such code will cause crash. 4045 // patch such code will cause crash.
4041 // TODO(vegorov): if intrisifier can fully intrisify the function then we 4046 // TODO(vegorov): if intrisifier can fully intrisify the function then we
4042 // should not later try to optimize it. 4047 // should not later try to optimize it.
(...skipping 11522 matching lines...) Expand 10 before | Expand all | Expand 10 after
15565 return "_MirrorReference"; 15570 return "_MirrorReference";
15566 } 15571 }
15567 15572
15568 15573
15569 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 15574 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
15570 JSONObject jsobj(stream); 15575 JSONObject jsobj(stream);
15571 } 15576 }
15572 15577
15573 15578
15574 } // namespace dart 15579 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698