| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 | 2142 |
| 2143 | 2143 |
| 2144 JSRegExp::Type JSRegExp::TypeTag() { | 2144 JSRegExp::Type JSRegExp::TypeTag() { |
| 2145 Object* data = this->data(); | 2145 Object* data = this->data(); |
| 2146 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; | 2146 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; |
| 2147 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); | 2147 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); |
| 2148 return static_cast<JSRegExp::Type>(smi->value()); | 2148 return static_cast<JSRegExp::Type>(smi->value()); |
| 2149 } | 2149 } |
| 2150 | 2150 |
| 2151 | 2151 |
| 2152 JSRegExp::Flags JSRegExp::GetFlags() { |
| 2153 ASSERT(this->data()->IsFixedArray()); |
| 2154 Object* data = this->data(); |
| 2155 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kFlagsIndex)); |
| 2156 return Flags(smi->value()); |
| 2157 } |
| 2158 |
| 2159 |
| 2160 String* JSRegExp::Pattern() { |
| 2161 ASSERT(this->data()->IsFixedArray()); |
| 2162 Object* data = this->data(); |
| 2163 String* pattern= String::cast(FixedArray::cast(data)->get(kSourceIndex)); |
| 2164 return pattern; |
| 2165 } |
| 2166 |
| 2167 |
| 2152 Object* JSRegExp::DataAt(int index) { | 2168 Object* JSRegExp::DataAt(int index) { |
| 2153 ASSERT(TypeTag() != NOT_COMPILED); | 2169 ASSERT(TypeTag() != NOT_COMPILED); |
| 2154 return FixedArray::cast(data())->get(index); | 2170 return FixedArray::cast(data())->get(index); |
| 2155 } | 2171 } |
| 2156 | 2172 |
| 2157 | 2173 |
| 2158 bool JSObject::HasFastElements() { | 2174 bool JSObject::HasFastElements() { |
| 2159 return !elements()->IsDictionary(); | 2175 return !elements()->IsDictionary(); |
| 2160 } | 2176 } |
| 2161 | 2177 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 #undef WRITE_INT_FIELD | 2376 #undef WRITE_INT_FIELD |
| 2361 #undef READ_SHORT_FIELD | 2377 #undef READ_SHORT_FIELD |
| 2362 #undef WRITE_SHORT_FIELD | 2378 #undef WRITE_SHORT_FIELD |
| 2363 #undef READ_BYTE_FIELD | 2379 #undef READ_BYTE_FIELD |
| 2364 #undef WRITE_BYTE_FIELD | 2380 #undef WRITE_BYTE_FIELD |
| 2365 | 2381 |
| 2366 | 2382 |
| 2367 } } // namespace v8::internal | 2383 } } // namespace v8::internal |
| 2368 | 2384 |
| 2369 #endif // V8_OBJECTS_INL_H_ | 2385 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |