| 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 12543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12554 } | 12554 } |
| 12555 | 12555 |
| 12556 | 12556 |
| 12557 intptr_t ContextScope::TokenIndexAt(intptr_t scope_index) const { | 12557 intptr_t ContextScope::TokenIndexAt(intptr_t scope_index) const { |
| 12558 return Smi::Value(VariableDescAddr(scope_index)->token_pos); | 12558 return Smi::Value(VariableDescAddr(scope_index)->token_pos); |
| 12559 } | 12559 } |
| 12560 | 12560 |
| 12561 | 12561 |
| 12562 void ContextScope::SetTokenIndexAt(intptr_t scope_index, | 12562 void ContextScope::SetTokenIndexAt(intptr_t scope_index, |
| 12563 intptr_t token_pos) const { | 12563 intptr_t token_pos) const { |
| 12564 VariableDescAddr(scope_index)->token_pos = Smi::New(token_pos); | 12564 StoreSmi(&VariableDescAddr(scope_index)->token_pos, |
| 12565 Smi::New(token_pos)); |
| 12565 } | 12566 } |
| 12566 | 12567 |
| 12567 | 12568 |
| 12568 RawString* ContextScope::NameAt(intptr_t scope_index) const { | 12569 RawString* ContextScope::NameAt(intptr_t scope_index) const { |
| 12569 return VariableDescAddr(scope_index)->name; | 12570 return VariableDescAddr(scope_index)->name; |
| 12570 } | 12571 } |
| 12571 | 12572 |
| 12572 | 12573 |
| 12573 void ContextScope::SetNameAt(intptr_t scope_index, const String& name) const { | 12574 void ContextScope::SetNameAt(intptr_t scope_index, const String& name) const { |
| 12574 StorePointer(&(VariableDescAddr(scope_index)->name), name.raw()); | 12575 StorePointer(&(VariableDescAddr(scope_index)->name), name.raw()); |
| 12575 } | 12576 } |
| 12576 | 12577 |
| 12577 | 12578 |
| 12578 bool ContextScope::IsFinalAt(intptr_t scope_index) const { | 12579 bool ContextScope::IsFinalAt(intptr_t scope_index) const { |
| 12579 return Bool::Handle(VariableDescAddr(scope_index)->is_final).value(); | 12580 return Bool::Handle(VariableDescAddr(scope_index)->is_final).value(); |
| 12580 } | 12581 } |
| 12581 | 12582 |
| 12582 | 12583 |
| 12583 void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const { | 12584 void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const { |
| 12584 VariableDescAddr(scope_index)->is_final = Bool::Get(is_final).raw(); | 12585 StorePointer(&(VariableDescAddr(scope_index)->is_final), |
| 12586 Bool::Get(is_final).raw()); |
| 12585 } | 12587 } |
| 12586 | 12588 |
| 12587 | 12589 |
| 12588 bool ContextScope::IsConstAt(intptr_t scope_index) const { | 12590 bool ContextScope::IsConstAt(intptr_t scope_index) const { |
| 12589 return Bool::Handle(VariableDescAddr(scope_index)->is_const).value(); | 12591 return Bool::Handle(VariableDescAddr(scope_index)->is_const).value(); |
| 12590 } | 12592 } |
| 12591 | 12593 |
| 12592 | 12594 |
| 12593 void ContextScope::SetIsConstAt(intptr_t scope_index, bool is_const) const { | 12595 void ContextScope::SetIsConstAt(intptr_t scope_index, bool is_const) const { |
| 12594 VariableDescAddr(scope_index)->is_const = Bool::Get(is_const).raw(); | 12596 StorePointer(&(VariableDescAddr(scope_index)->is_const), |
| 12597 Bool::Get(is_const).raw()); |
| 12595 } | 12598 } |
| 12596 | 12599 |
| 12597 | 12600 |
| 12598 RawAbstractType* ContextScope::TypeAt(intptr_t scope_index) const { | 12601 RawAbstractType* ContextScope::TypeAt(intptr_t scope_index) const { |
| 12599 ASSERT(!IsConstAt(scope_index)); | 12602 ASSERT(!IsConstAt(scope_index)); |
| 12600 return VariableDescAddr(scope_index)->type; | 12603 return VariableDescAddr(scope_index)->type; |
| 12601 } | 12604 } |
| 12602 | 12605 |
| 12603 | 12606 |
| 12604 void ContextScope::SetTypeAt( | 12607 void ContextScope::SetTypeAt( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 12620 } | 12623 } |
| 12621 | 12624 |
| 12622 | 12625 |
| 12623 intptr_t ContextScope::ContextIndexAt(intptr_t scope_index) const { | 12626 intptr_t ContextScope::ContextIndexAt(intptr_t scope_index) const { |
| 12624 return Smi::Value(VariableDescAddr(scope_index)->context_index); | 12627 return Smi::Value(VariableDescAddr(scope_index)->context_index); |
| 12625 } | 12628 } |
| 12626 | 12629 |
| 12627 | 12630 |
| 12628 void ContextScope::SetContextIndexAt(intptr_t scope_index, | 12631 void ContextScope::SetContextIndexAt(intptr_t scope_index, |
| 12629 intptr_t context_index) const { | 12632 intptr_t context_index) const { |
| 12630 VariableDescAddr(scope_index)->context_index = Smi::New(context_index); | 12633 StoreSmi(&(VariableDescAddr(scope_index)->context_index), |
| 12634 Smi::New(context_index)); |
| 12631 } | 12635 } |
| 12632 | 12636 |
| 12633 | 12637 |
| 12634 intptr_t ContextScope::ContextLevelAt(intptr_t scope_index) const { | 12638 intptr_t ContextScope::ContextLevelAt(intptr_t scope_index) const { |
| 12635 return Smi::Value(VariableDescAddr(scope_index)->context_level); | 12639 return Smi::Value(VariableDescAddr(scope_index)->context_level); |
| 12636 } | 12640 } |
| 12637 | 12641 |
| 12638 | 12642 |
| 12639 void ContextScope::SetContextLevelAt(intptr_t scope_index, | 12643 void ContextScope::SetContextLevelAt(intptr_t scope_index, |
| 12640 intptr_t context_level) const { | 12644 intptr_t context_level) const { |
| 12641 VariableDescAddr(scope_index)->context_level = Smi::New(context_level); | 12645 StoreSmi(&(VariableDescAddr(scope_index)->context_level), |
| 12646 Smi::New(context_level)); |
| 12642 } | 12647 } |
| 12643 | 12648 |
| 12644 | 12649 |
| 12645 const char* ContextScope::ToCString() const { | 12650 const char* ContextScope::ToCString() const { |
| 12646 return "ContextScope"; | 12651 return "ContextScope"; |
| 12647 } | 12652 } |
| 12648 | 12653 |
| 12649 | 12654 |
| 12650 void ContextScope::PrintJSONImpl(JSONStream* stream, bool ref) const { | 12655 void ContextScope::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 12651 Object::PrintJSONImpl(stream, ref); | 12656 Object::PrintJSONImpl(stream, ref); |
| (...skipping 7662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20314 return tag_label.ToCString(); | 20319 return tag_label.ToCString(); |
| 20315 } | 20320 } |
| 20316 | 20321 |
| 20317 | 20322 |
| 20318 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20323 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20319 Instance::PrintJSONImpl(stream, ref); | 20324 Instance::PrintJSONImpl(stream, ref); |
| 20320 } | 20325 } |
| 20321 | 20326 |
| 20322 | 20327 |
| 20323 } // namespace dart | 20328 } // namespace dart |
| OLD | NEW |