| OLD | NEW |
| 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 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 return Function::null(); | 2274 return Function::null(); |
| 2275 } | 2275 } |
| 2276 return Function::Cast(object).raw(); | 2276 return Function::Cast(object).raw(); |
| 2277 } | 2277 } |
| 2278 | 2278 |
| 2279 | 2279 |
| 2280 void Class::AddClosureFunction(const Function& function) const { | 2280 void Class::AddClosureFunction(const Function& function) const { |
| 2281 GrowableObjectArray& closures = | 2281 GrowableObjectArray& closures = |
| 2282 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); | 2282 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); |
| 2283 if (closures.IsNull()) { | 2283 if (closures.IsNull()) { |
| 2284 closures = GrowableObjectArray::New(4); | 2284 closures = GrowableObjectArray::New(4, Heap::kOld); |
| 2285 StorePointer(&raw_ptr()->closure_functions_, closures.raw()); | 2285 StorePointer(&raw_ptr()->closure_functions_, closures.raw()); |
| 2286 } | 2286 } |
| 2287 ASSERT(function.IsNonImplicitClosureFunction()); | 2287 ASSERT(function.IsNonImplicitClosureFunction()); |
| 2288 ASSERT(function.Owner() == this->raw()); | 2288 ASSERT(function.Owner() == this->raw()); |
| 2289 closures.Add(function); | 2289 closures.Add(function, Heap::kOld); |
| 2290 } | 2290 } |
| 2291 | 2291 |
| 2292 | 2292 |
| 2293 // Lookup the innermost closure function that contains token at token_pos. | 2293 // Lookup the innermost closure function that contains token at token_pos. |
| 2294 RawFunction* Class::LookupClosureFunction(intptr_t token_pos) const { | 2294 RawFunction* Class::LookupClosureFunction(intptr_t token_pos) const { |
| 2295 if (raw_ptr()->closure_functions_ == GrowableObjectArray::null()) { | 2295 if (raw_ptr()->closure_functions_ == GrowableObjectArray::null()) { |
| 2296 return Function::null(); | 2296 return Function::null(); |
| 2297 } | 2297 } |
| 2298 const GrowableObjectArray& closures = | 2298 const GrowableObjectArray& closures = |
| 2299 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); | 2299 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); |
| (...skipping 19230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21530 return tag_label.ToCString(); | 21530 return tag_label.ToCString(); |
| 21531 } | 21531 } |
| 21532 | 21532 |
| 21533 | 21533 |
| 21534 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21534 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21535 Instance::PrintJSONImpl(stream, ref); | 21535 Instance::PrintJSONImpl(stream, ref); |
| 21536 } | 21536 } |
| 21537 | 21537 |
| 21538 | 21538 |
| 21539 } // namespace dart | 21539 } // namespace dart |
| OLD | NEW |