| 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 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3607 parameter_names.SetAt(index, value); | 3607 parameter_names.SetAt(index, value); |
| 3608 } | 3608 } |
| 3609 | 3609 |
| 3610 | 3610 |
| 3611 void Function::set_parameter_names(const Array& value) const { | 3611 void Function::set_parameter_names(const Array& value) const { |
| 3612 StorePointer(&raw_ptr()->parameter_names_, value.raw()); | 3612 StorePointer(&raw_ptr()->parameter_names_, value.raw()); |
| 3613 } | 3613 } |
| 3614 | 3614 |
| 3615 | 3615 |
| 3616 void Function::set_kind(RawFunction::Kind value) const { | 3616 void Function::set_kind(RawFunction::Kind value) const { |
| 3617 raw()->SetKind(value); | 3617 uword bits = raw_ptr()->kind_tag_; |
| 3618 raw_ptr()->kind_tag_ = KindBits::update(value, bits); |
| 3618 } | 3619 } |
| 3619 | 3620 |
| 3620 | 3621 |
| 3621 void Function::set_is_static(bool is_static) const { | 3622 void Function::set_is_static(bool is_static) const { |
| 3622 raw()->SetIsStatic(is_static); | 3623 uword bits = raw_ptr()->kind_tag_; |
| 3624 raw_ptr()->kind_tag_ = StaticBit::update(is_static, bits); |
| 3623 } | 3625 } |
| 3624 | 3626 |
| 3625 | 3627 |
| 3626 void Function::set_is_const(bool is_const) const { | 3628 void Function::set_is_const(bool is_const) const { |
| 3627 raw()->SetIsConst(is_const); | 3629 uword bits = raw_ptr()->kind_tag_; |
| 3630 raw_ptr()->kind_tag_ = ConstBit::update(is_const, bits); |
| 3628 } | 3631 } |
| 3629 | 3632 |
| 3630 | 3633 |
| 3631 void Function::set_is_external(bool is_external) const { | 3634 void Function::set_is_external(bool is_external) const { |
| 3632 raw()->SetIsExternal(is_external); | 3635 uword bits = raw_ptr()->kind_tag_; |
| 3636 raw_ptr()->kind_tag_ = ExternalBit::update(is_external, bits); |
| 3633 } | 3637 } |
| 3634 | 3638 |
| 3635 | 3639 |
| 3636 void Function::set_token_pos(intptr_t pos) const { | 3640 void Function::set_token_pos(intptr_t pos) const { |
| 3637 ASSERT(pos >= 0); | 3641 ASSERT(pos >= 0); |
| 3638 raw_ptr()->token_pos_ = pos; | 3642 raw_ptr()->token_pos_ = pos; |
| 3639 } | 3643 } |
| 3640 | 3644 |
| 3641 | 3645 |
| 3646 void Function::set_kind_tag(intptr_t value) const { |
| 3647 raw_ptr()->kind_tag_ = value; |
| 3648 } |
| 3649 |
| 3650 |
| 3642 void Function::set_num_fixed_parameters(intptr_t n) const { | 3651 void Function::set_num_fixed_parameters(intptr_t n) const { |
| 3643 ASSERT(n >= 0); | 3652 ASSERT(n >= 0); |
| 3644 raw_ptr()->num_fixed_parameters_ = n; | 3653 raw_ptr()->num_fixed_parameters_ = n; |
| 3645 } | 3654 } |
| 3646 | 3655 |
| 3647 | 3656 |
| 3648 void Function::set_num_optional_parameters(intptr_t n) const { | 3657 void Function::set_num_optional_parameters(intptr_t n) const { |
| 3649 ASSERT(n >= 0); | 3658 ASSERT(n >= 0); |
| 3650 raw_ptr()->num_optional_parameters_ = n; | 3659 raw_ptr()->num_optional_parameters_ = n; |
| 3651 } | 3660 } |
| 3652 | 3661 |
| 3653 | 3662 |
| 3654 void Function::set_is_optimizable(bool value) const { | 3663 void Function::set_is_optimizable(bool value) const { |
| 3655 raw()->SetIsOptimizable(value); | 3664 uword bits = raw_ptr()->kind_tag_; |
| 3665 raw_ptr()->kind_tag_ = OptimizableBit::update(value, bits); |
| 3656 } | 3666 } |
| 3657 | 3667 |
| 3658 | 3668 |
| 3659 void Function::set_has_finally(bool value) const { | 3669 void Function::set_has_finally(bool value) const { |
| 3660 raw()->SetHasFinally(value); | 3670 uword bits = raw_ptr()->kind_tag_; |
| 3671 raw_ptr()->kind_tag_ = HasFinallyBit::update(value, bits); |
| 3661 } | 3672 } |
| 3662 | 3673 |
| 3663 | 3674 |
| 3664 void Function::set_is_native(bool value) const { | 3675 void Function::set_is_native(bool value) const { |
| 3665 raw()->SetIsNative(value); | 3676 uword bits = raw_ptr()->kind_tag_; |
| 3677 raw_ptr()->kind_tag_ = NativeBit::update(value, bits); |
| 3666 } | 3678 } |
| 3667 | 3679 |
| 3668 | 3680 |
| 3669 void Function::set_is_abstract(bool value) const { | 3681 void Function::set_is_abstract(bool value) const { |
| 3670 raw()->SetIsAbstract(value); | 3682 uword bits = raw_ptr()->kind_tag_; |
| 3683 raw_ptr()->kind_tag_ = AbstractBit::update(value, bits); |
| 3671 } | 3684 } |
| 3672 | 3685 |
| 3673 | 3686 |
| 3674 intptr_t Function::NumberOfParameters() const { | 3687 intptr_t Function::NumberOfParameters() const { |
| 3675 return num_fixed_parameters() + num_optional_parameters(); | 3688 return num_fixed_parameters() + num_optional_parameters(); |
| 3676 } | 3689 } |
| 3677 | 3690 |
| 3678 | 3691 |
| 3679 intptr_t Function::NumberOfImplicitParameters() const { | 3692 intptr_t Function::NumberOfImplicitParameters() const { |
| 3680 if (kind() == RawFunction::kConstructor) { | 3693 if (kind() == RawFunction::kConstructor) { |
| (...skipping 7304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10985 const char* JSRegExp::ToCString() const { | 10998 const char* JSRegExp::ToCString() const { |
| 10986 const String& str = String::Handle(pattern()); | 10999 const String& str = String::Handle(pattern()); |
| 10987 const char* format = "JSRegExp: pattern=%s flags=%s"; | 11000 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 10988 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 11001 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 10989 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); | 11002 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1); |
| 10990 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 11003 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 10991 return chars; | 11004 return chars; |
| 10992 } | 11005 } |
| 10993 | 11006 |
| 10994 } // namespace dart | 11007 } // namespace dart |
| OLD | NEW |