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

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

Issue 252893002: Fix registration of closure functions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/flow_graph_builder.cc ('k') | no next file » | 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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 1972
1973 1973
1974 void Class::AddClosureFunction(const Function& function) const { 1974 void Class::AddClosureFunction(const Function& function) const {
1975 GrowableObjectArray& closures = 1975 GrowableObjectArray& closures =
1976 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); 1976 GrowableObjectArray::Handle(raw_ptr()->closure_functions_);
1977 if (closures.IsNull()) { 1977 if (closures.IsNull()) {
1978 closures = GrowableObjectArray::New(4); 1978 closures = GrowableObjectArray::New(4);
1979 StorePointer(&raw_ptr()->closure_functions_, closures.raw()); 1979 StorePointer(&raw_ptr()->closure_functions_, closures.raw());
1980 } 1980 }
1981 ASSERT(function.IsNonImplicitClosureFunction()); 1981 ASSERT(function.IsNonImplicitClosureFunction());
1982 ASSERT(function.Owner() == this->raw());
1982 closures.Add(function); 1983 closures.Add(function);
1983 } 1984 }
1984 1985
1985 1986
1986 // Lookup the innermost closure function that contains token at token_pos. 1987 // Lookup the innermost closure function that contains token at token_pos.
1987 RawFunction* Class::LookupClosureFunction(intptr_t token_pos) const { 1988 RawFunction* Class::LookupClosureFunction(intptr_t token_pos) const {
1988 if (raw_ptr()->closure_functions_ == GrowableObjectArray::null()) { 1989 if (raw_ptr()->closure_functions_ == GrowableObjectArray::null()) {
1989 return Function::null(); 1990 return Function::null();
1990 } 1991 }
1991 const GrowableObjectArray& closures = 1992 const GrowableObjectArray& closures =
(...skipping 16648 matching lines...) Expand 10 before | Expand all | Expand 10 after
18640 return tag_label.ToCString(); 18641 return tag_label.ToCString();
18641 } 18642 }
18642 18643
18643 18644
18644 void UserTag::PrintToJSONStream(JSONStream* stream, bool ref) const { 18645 void UserTag::PrintToJSONStream(JSONStream* stream, bool ref) const {
18645 Instance::PrintToJSONStream(stream, ref); 18646 Instance::PrintToJSONStream(stream, ref);
18646 } 18647 }
18647 18648
18648 18649
18649 } // namespace dart 18650 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698