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

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

Issue 1400193003: Don't assume at least one closure function is encountered before tree-shaking. Allow… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.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 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 Object& object = thread->ObjectHandle(); 2334 Object& object = thread->ObjectHandle();
2335 dispatcher_cache ^= invocation_dispatcher_cache(); 2335 dispatcher_cache ^= invocation_dispatcher_cache();
2336 object = dispatcher_cache.At(idx); 2336 object = dispatcher_cache.At(idx);
2337 if (!object.IsFunction()) { 2337 if (!object.IsFunction()) {
2338 return Function::null(); 2338 return Function::null();
2339 } 2339 }
2340 return Function::Cast(object).raw(); 2340 return Function::Cast(object).raw();
2341 } 2341 }
2342 2342
2343 2343
2344 void Class::set_closures(const GrowableObjectArray& value) const {
2345 StorePointer(&raw_ptr()->closure_functions_, value.raw());
2346 }
2347
2348
2344 void Class::AddClosureFunction(const Function& function) const { 2349 void Class::AddClosureFunction(const Function& function) const {
2345 GrowableObjectArray& closures = 2350 GrowableObjectArray& closures =
2346 GrowableObjectArray::Handle(raw_ptr()->closure_functions_); 2351 GrowableObjectArray::Handle(raw_ptr()->closure_functions_);
2347 if (closures.IsNull()) { 2352 if (closures.IsNull()) {
2348 closures = GrowableObjectArray::New(4, Heap::kOld); 2353 closures = GrowableObjectArray::New(4, Heap::kOld);
2349 StorePointer(&raw_ptr()->closure_functions_, closures.raw()); 2354 StorePointer(&raw_ptr()->closure_functions_, closures.raw());
2350 } 2355 }
2351 ASSERT(function.IsNonImplicitClosureFunction()); 2356 ASSERT(function.IsNonImplicitClosureFunction());
2352 ASSERT(function.Owner() == this->raw()); 2357 ASSERT(function.Owner() == this->raw());
2353 closures.Add(function, Heap::kOld); 2358 closures.Add(function, Heap::kOld);
(...skipping 19213 matching lines...) Expand 10 before | Expand all | Expand 10 after
21567 return tag_label.ToCString(); 21572 return tag_label.ToCString();
21568 } 21573 }
21569 21574
21570 21575
21571 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21576 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21572 Instance::PrintJSONImpl(stream, ref); 21577 Instance::PrintJSONImpl(stream, ref);
21573 } 21578 }
21574 21579
21575 21580
21576 } // namespace dart 21581 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698