| 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 16372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16383 return LanguageError::null(); | 16383 return LanguageError::null(); |
| 16384 } | 16384 } |
| 16385 | 16385 |
| 16386 | 16386 |
| 16387 void Type::set_error(const LanguageError& value) const { | 16387 void Type::set_error(const LanguageError& value) const { |
| 16388 StorePointer(&raw_ptr()->sig_or_err_.error_, value.raw()); | 16388 StorePointer(&raw_ptr()->sig_or_err_.error_, value.raw()); |
| 16389 } | 16389 } |
| 16390 | 16390 |
| 16391 | 16391 |
| 16392 RawFunction* Type::signature() const { | 16392 RawFunction* Type::signature() const { |
| 16393 if (raw_ptr()->sig_or_err_.signature_ == Function::null()) { | 16393 intptr_t cid = raw_ptr()->sig_or_err_.signature_->GetClassId(); |
| 16394 if (cid == kNullCid) { |
| 16394 return Function::null(); | 16395 return Function::null(); |
| 16395 } | 16396 } |
| 16396 const Object& obj = Object::Handle(raw_ptr()->sig_or_err_.signature_); | 16397 if (cid == kFunctionCid) { |
| 16397 if (obj.IsFunction()) { | 16398 return Function::RawCast(raw_ptr()->sig_or_err_.signature_); |
| 16398 return Function::RawCast(obj.raw()); | |
| 16399 } | 16399 } |
| 16400 ASSERT(obj.IsLanguageError()); // Type is malformed or malbounded. | 16400 ASSERT(cid == kLanguageErrorCid); // Type is malformed or malbounded. |
| 16401 return Function::null(); | 16401 return Function::null(); |
| 16402 } | 16402 } |
| 16403 | 16403 |
| 16404 | 16404 |
| 16405 void Type::set_signature(const Function& value) const { | 16405 void Type::set_signature(const Function& value) const { |
| 16406 StorePointer(&raw_ptr()->sig_or_err_.signature_, value.raw()); | 16406 StorePointer(&raw_ptr()->sig_or_err_.signature_, value.raw()); |
| 16407 } | 16407 } |
| 16408 | 16408 |
| 16409 | 16409 |
| 16410 void Type::SetIsResolved() const { | 16410 void Type::SetIsResolved() const { |
| (...skipping 5984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22395 return UserTag::null(); | 22395 return UserTag::null(); |
| 22396 } | 22396 } |
| 22397 | 22397 |
| 22398 | 22398 |
| 22399 const char* UserTag::ToCString() const { | 22399 const char* UserTag::ToCString() const { |
| 22400 const String& tag_label = String::Handle(label()); | 22400 const String& tag_label = String::Handle(label()); |
| 22401 return tag_label.ToCString(); | 22401 return tag_label.ToCString(); |
| 22402 } | 22402 } |
| 22403 | 22403 |
| 22404 } // namespace dart | 22404 } // namespace dart |
| OLD | NEW |