| 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 "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 4142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4153 } | 4153 } |
| 4154 | 4154 |
| 4155 | 4155 |
| 4156 RawString* Field::NameFromSetter(const String& setter_name) { | 4156 RawString* Field::NameFromSetter(const String& setter_name) { |
| 4157 String& str = String::Handle(); | 4157 String& str = String::Handle(); |
| 4158 str = String::SubString(setter_name, strlen(kSetterPrefix)); | 4158 str = String::SubString(setter_name, strlen(kSetterPrefix)); |
| 4159 return str.raw(); | 4159 return str.raw(); |
| 4160 } | 4160 } |
| 4161 | 4161 |
| 4162 | 4162 |
| 4163 bool Field::IsGetterName(const String& function_name) { |
| 4164 return function_name.StartsWith(String::Handle(String::New(kGetterPrefix))); |
| 4165 } |
| 4166 |
| 4167 |
| 4168 bool Field::IsSetterName(const String& function_name) { |
| 4169 return function_name.StartsWith(String::Handle(String::New(kSetterPrefix))); |
| 4170 } |
| 4171 |
| 4172 |
| 4163 void Field::set_name(const String& value) const { | 4173 void Field::set_name(const String& value) const { |
| 4164 ASSERT(value.IsSymbol()); | 4174 ASSERT(value.IsSymbol()); |
| 4165 StorePointer(&raw_ptr()->name_, value.raw()); | 4175 StorePointer(&raw_ptr()->name_, value.raw()); |
| 4166 } | 4176 } |
| 4167 | 4177 |
| 4168 | 4178 |
| 4169 RawInstance* Field::value() const { | 4179 RawInstance* Field::value() const { |
| 4170 ASSERT(is_static()); // Valid only for static dart fields. | 4180 ASSERT(is_static()); // Valid only for static dart fields. |
| 4171 return raw_ptr()->value_; | 4181 return raw_ptr()->value_; |
| 4172 } | 4182 } |
| (...skipping 5926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10099 const String& str = String::Handle(pattern()); | 10109 const String& str = String::Handle(pattern()); |
| 10100 const char* format = "JSRegExp: pattern=%s flags=%s"; | 10110 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 10101 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 10111 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 10102 char* chars = reinterpret_cast<char*>( | 10112 char* chars = reinterpret_cast<char*>( |
| 10103 Isolate::Current()->current_zone()->Allocate(len + 1)); | 10113 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 10104 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 10114 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 10105 return chars; | 10115 return chars; |
| 10106 } | 10116 } |
| 10107 | 10117 |
| 10108 } // namespace dart | 10118 } // namespace dart |
| OLD | NEW |