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

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

Issue 2829933002: Trace signature types in the tree shaker. (Closed)
Patch Set: . Created 3 years, 8 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/become.h" 10 #include "vm/become.h"
(...skipping 5635 matching lines...) Expand 10 before | Expand all | Expand 10 after
5646 ASSERT(obj.IsArray()); 5646 ASSERT(obj.IsArray());
5647 ASSERT((Array::Cast(obj).At(1) == Object::null()) || value.IsNull()); 5647 ASSERT((Array::Cast(obj).At(1) == Object::null()) || value.IsNull());
5648 Array::Cast(obj).SetAt(1, value); 5648 Array::Cast(obj).SetAt(1, value);
5649 } else { 5649 } else {
5650 ASSERT((raw_ptr()->data_ == Object::null()) || value.IsNull()); 5650 ASSERT((raw_ptr()->data_ == Object::null()) || value.IsNull());
5651 set_data(value); 5651 set_data(value);
5652 } 5652 }
5653 } 5653 }
5654 5654
5655 5655
5656 RawType* Function::ExistingSignatureType() const {
5657 const Object& obj = Object::Handle(raw_ptr()->data_);
5658 ASSERT(!obj.IsNull());
5659 if (IsSignatureFunction()) {
5660 return SignatureData::Cast(obj).signature_type();
5661 } else {
5662 ASSERT(IsClosureFunction());
5663 return ClosureData::Cast(obj).signature_type();
5664 }
5665 }
5666
5667
5656 RawType* Function::SignatureType() const { 5668 RawType* Function::SignatureType() const {
5657 Type& type = Type::Handle(); 5669 Type& type = Type::Handle(ExistingSignatureType());
5658 const Object& obj = Object::Handle(raw_ptr()->data_);
5659 ASSERT(!obj.IsNull());
5660 if (IsSignatureFunction()) {
5661 type = SignatureData::Cast(obj).signature_type();
5662 } else {
5663 ASSERT(IsClosureFunction());
5664 type = ClosureData::Cast(obj).signature_type();
5665 }
5666 if (type.IsNull()) { 5670 if (type.IsNull()) {
5667 // The function type of this function is not yet cached and needs to be 5671 // The function type of this function is not yet cached and needs to be
5668 // constructed and cached here. 5672 // constructed and cached here.
5669 // A function type is type parameterized in the same way as the owner class 5673 // A function type is type parameterized in the same way as the owner class
5670 // of its non-static signature function. 5674 // of its non-static signature function.
5671 // It is not type parameterized if its signature function is static, or if 5675 // It is not type parameterized if its signature function is static, or if
5672 // none of its result type or formal parameter types are type parameterized. 5676 // none of its result type or formal parameter types are type parameterized.
5673 // Unless the function type is a generic typedef, the type arguments of the 5677 // Unless the function type is a generic typedef, the type arguments of the
5674 // function type are not explicitly stored in the function type as a vector 5678 // function type are not explicitly stored in the function type as a vector
5675 // of type arguments. 5679 // of type arguments.
(...skipping 17510 matching lines...) Expand 10 before | Expand all | Expand 10 after
23186 return UserTag::null(); 23190 return UserTag::null();
23187 } 23191 }
23188 23192
23189 23193
23190 const char* UserTag::ToCString() const { 23194 const char* UserTag::ToCString() const {
23191 const String& tag_label = String::Handle(label()); 23195 const String& tag_label = String::Handle(label());
23192 return tag_label.ToCString(); 23196 return tag_label.ToCString();
23193 } 23197 }
23194 23198
23195 } // namespace dart 23199 } // 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