| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3132 | 3132 |
| 3133 | 3133 |
| 3134 RawString* Field::SetterName(const String& field_name) { | 3134 RawString* Field::SetterName(const String& field_name) { |
| 3135 String& str = String::Handle(); | 3135 String& str = String::Handle(); |
| 3136 str = String::New("set:"); | 3136 str = String::New("set:"); |
| 3137 str = String::Concat(str, field_name); | 3137 str = String::Concat(str, field_name); |
| 3138 return String::NewSymbol(str); | 3138 return String::NewSymbol(str); |
| 3139 } | 3139 } |
| 3140 | 3140 |
| 3141 | 3141 |
| 3142 RawString* Field::NameFromGetter(const String& getter_name) { |
| 3143 String& str = String::Handle(); |
| 3144 str = String::New("get:"); |
| 3145 str = String::SubString(getter_name, str.Length()); |
| 3146 return String::NewSymbol(str); |
| 3147 } |
| 3148 |
| 3149 |
| 3150 RawString* Field::NameFromSetter(const String& setter_name) { |
| 3151 String& str = String::Handle(); |
| 3152 str = String::New("set:"); |
| 3153 str = String::SubString(setter_name, str.Length()); |
| 3154 return String::NewSymbol(str); |
| 3155 } |
| 3156 |
| 3157 |
| 3142 void Field::set_name(const String& value) const { | 3158 void Field::set_name(const String& value) const { |
| 3143 ASSERT(value.IsSymbol()); | 3159 ASSERT(value.IsSymbol()); |
| 3144 StorePointer(&raw_ptr()->name_, value.raw()); | 3160 StorePointer(&raw_ptr()->name_, value.raw()); |
| 3145 } | 3161 } |
| 3146 | 3162 |
| 3147 | 3163 |
| 3148 RawInstance* Field::value() const { | 3164 RawInstance* Field::value() const { |
| 3149 ASSERT(is_static()); // Valid only for static dart fields. | 3165 ASSERT(is_static()); // Valid only for static dart fields. |
| 3150 return raw_ptr()->value_; | 3166 return raw_ptr()->value_; |
| 3151 } | 3167 } |
| (...skipping 3536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6688 const String& str = String::Handle(pattern()); | 6704 const String& str = String::Handle(pattern()); |
| 6689 const char* format = "JSRegExp: pattern=%s flags=%s"; | 6705 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 6690 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 6706 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 6691 char* chars = reinterpret_cast<char*>( | 6707 char* chars = reinterpret_cast<char*>( |
| 6692 Isolate::Current()->current_zone()->Allocate(len + 1)); | 6708 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 6693 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 6709 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 6694 return chars; | 6710 return chars; |
| 6695 } | 6711 } |
| 6696 | 6712 |
| 6697 } // namespace dart | 6713 } // namespace dart |
| OLD | NEW |