| 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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 3447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3458 } | 3458 } |
| 3459 | 3459 |
| 3460 | 3460 |
| 3461 RawAbstractType* TypeArguments::TypeAt(intptr_t index) const { | 3461 RawAbstractType* TypeArguments::TypeAt(intptr_t index) const { |
| 3462 return *TypeAddr(index); | 3462 return *TypeAddr(index); |
| 3463 } | 3463 } |
| 3464 | 3464 |
| 3465 | 3465 |
| 3466 void TypeArguments::SetTypeAt(intptr_t index, const AbstractType& value) const { | 3466 void TypeArguments::SetTypeAt(intptr_t index, const AbstractType& value) const { |
| 3467 ASSERT(!IsCanonical()); | 3467 ASSERT(!IsCanonical()); |
| 3468 // TODO(iposva): Add storing NoGCScope. | 3468 StorePointer(TypeAddr(index), value.raw()); |
| 3469 *TypeAddr(index) = value.raw(); | |
| 3470 } | 3469 } |
| 3471 | 3470 |
| 3472 | 3471 |
| 3473 bool TypeArguments::IsResolved() const { | 3472 bool TypeArguments::IsResolved() const { |
| 3474 AbstractType& type = AbstractType::Handle(); | 3473 AbstractType& type = AbstractType::Handle(); |
| 3475 intptr_t num_types = Length(); | 3474 intptr_t num_types = Length(); |
| 3476 for (intptr_t i = 0; i < num_types; i++) { | 3475 for (intptr_t i = 0; i < num_types; i++) { |
| 3477 type = TypeAt(i); | 3476 type = TypeAt(i); |
| 3478 if (!type.IsResolved()) { | 3477 if (!type.IsResolved()) { |
| 3479 return false; | 3478 return false; |
| (...skipping 3962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7442 VariableDescAddr(scope_index)->token_pos = Smi::New(token_pos); | 7441 VariableDescAddr(scope_index)->token_pos = Smi::New(token_pos); |
| 7443 } | 7442 } |
| 7444 | 7443 |
| 7445 | 7444 |
| 7446 RawString* ContextScope::NameAt(intptr_t scope_index) const { | 7445 RawString* ContextScope::NameAt(intptr_t scope_index) const { |
| 7447 return VariableDescAddr(scope_index)->name; | 7446 return VariableDescAddr(scope_index)->name; |
| 7448 } | 7447 } |
| 7449 | 7448 |
| 7450 | 7449 |
| 7451 void ContextScope::SetNameAt(intptr_t scope_index, const String& name) const { | 7450 void ContextScope::SetNameAt(intptr_t scope_index, const String& name) const { |
| 7452 VariableDescAddr(scope_index)->name = name.raw(); | 7451 StorePointer(&(VariableDescAddr(scope_index)->name), name.raw()); |
| 7453 } | 7452 } |
| 7454 | 7453 |
| 7455 | 7454 |
| 7456 bool ContextScope::IsFinalAt(intptr_t scope_index) const { | 7455 bool ContextScope::IsFinalAt(intptr_t scope_index) const { |
| 7457 return Bool::Handle(VariableDescAddr(scope_index)->is_final).value(); | 7456 return Bool::Handle(VariableDescAddr(scope_index)->is_final).value(); |
| 7458 } | 7457 } |
| 7459 | 7458 |
| 7460 | 7459 |
| 7461 void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const { | 7460 void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const { |
| 7462 VariableDescAddr(scope_index)->is_final = Bool::Get(is_final); | 7461 VariableDescAddr(scope_index)->is_final = Bool::Get(is_final); |
| 7463 } | 7462 } |
| 7464 | 7463 |
| 7465 | 7464 |
| 7466 RawAbstractType* ContextScope::TypeAt(intptr_t scope_index) const { | 7465 RawAbstractType* ContextScope::TypeAt(intptr_t scope_index) const { |
| 7467 return VariableDescAddr(scope_index)->type; | 7466 return VariableDescAddr(scope_index)->type; |
| 7468 } | 7467 } |
| 7469 | 7468 |
| 7470 | 7469 |
| 7471 void ContextScope::SetTypeAt( | 7470 void ContextScope::SetTypeAt( |
| 7472 intptr_t scope_index, const AbstractType& type) const { | 7471 intptr_t scope_index, const AbstractType& type) const { |
| 7473 VariableDescAddr(scope_index)->type = type.raw(); | 7472 StorePointer(&(VariableDescAddr(scope_index)->type), type.raw()); |
| 7474 } | 7473 } |
| 7475 | 7474 |
| 7476 | 7475 |
| 7477 intptr_t ContextScope::ContextIndexAt(intptr_t scope_index) const { | 7476 intptr_t ContextScope::ContextIndexAt(intptr_t scope_index) const { |
| 7478 return Smi::Value(VariableDescAddr(scope_index)->context_index); | 7477 return Smi::Value(VariableDescAddr(scope_index)->context_index); |
| 7479 } | 7478 } |
| 7480 | 7479 |
| 7481 | 7480 |
| 7482 void ContextScope::SetContextIndexAt(intptr_t scope_index, | 7481 void ContextScope::SetContextIndexAt(intptr_t scope_index, |
| 7483 intptr_t context_index) const { | 7482 intptr_t context_index) const { |
| (...skipping 3699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11183 } | 11182 } |
| 11184 return result.raw(); | 11183 return result.raw(); |
| 11185 } | 11184 } |
| 11186 | 11185 |
| 11187 | 11186 |
| 11188 const char* WeakProperty::ToCString() const { | 11187 const char* WeakProperty::ToCString() const { |
| 11189 return "_WeakProperty"; | 11188 return "_WeakProperty"; |
| 11190 } | 11189 } |
| 11191 | 11190 |
| 11192 } // namespace dart | 11191 } // namespace dart |
| OLD | NEW |