Chromium Code Reviews| 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 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2159 | 2159 |
| 2160 byte* Code::sinfo_start() { | 2160 byte* Code::sinfo_start() { |
| 2161 return FIELD_ADDR(this, CodeSize() - sinfo_size()); | 2161 return FIELD_ADDR(this, CodeSize() - sinfo_size()); |
| 2162 } | 2162 } |
| 2163 | 2163 |
| 2164 | 2164 |
| 2165 ACCESSORS(JSArray, length, Object, kLengthOffset) | 2165 ACCESSORS(JSArray, length, Object, kLengthOffset) |
| 2166 | 2166 |
| 2167 | 2167 |
| 2168 ACCESSORS(JSRegExp, data, Object, kDataOffset) | 2168 ACCESSORS(JSRegExp, data, Object, kDataOffset) |
| 2169 ACCESSORS(JSRegExp, type, Object, kTypeOffset) | |
| 2170 | 2169 |
| 2171 | 2170 |
| 2172 JSRegExp::Type JSRegExp::type_tag() { | 2171 JSRegExp::Type JSRegExp::TypeTag() { |
| 2173 return static_cast<JSRegExp::Type>(Smi::cast(type())->value()); | 2172 Object* data = this->data(); |
| 2173 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; | |
| 2174 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); | |
| 2175 return static_cast<JSRegExp::Type>(smi->value()); | |
| 2174 } | 2176 } |
| 2175 | 2177 |
| 2176 | 2178 |
| 2177 void JSRegExp::set_type_tag(JSRegExp::Type value) { | 2179 Object* JSRegExp::DataAt(int index) { |
| 2178 set_type(Smi::FromInt(value)); | 2180 return FixedArray::cast(data())->get(index); |
|
Kasper Lund
2008/10/24 06:42:50
Maybe you should add an ASSERT that data isn't und
| |
| 2179 } | 2181 } |
| 2180 | 2182 |
| 2181 | 2183 |
| 2182 bool JSObject::HasFastElements() { | 2184 bool JSObject::HasFastElements() { |
| 2183 return !elements()->IsDictionary(); | 2185 return !elements()->IsDictionary(); |
| 2184 } | 2186 } |
| 2185 | 2187 |
| 2186 | 2188 |
| 2187 bool JSObject::HasNamedInterceptor() { | 2189 bool JSObject::HasNamedInterceptor() { |
| 2188 return map()->has_named_interceptor(); | 2190 return map()->has_named_interceptor(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2384 #undef WRITE_INT_FIELD | 2386 #undef WRITE_INT_FIELD |
| 2385 #undef READ_SHORT_FIELD | 2387 #undef READ_SHORT_FIELD |
| 2386 #undef WRITE_SHORT_FIELD | 2388 #undef WRITE_SHORT_FIELD |
| 2387 #undef READ_BYTE_FIELD | 2389 #undef READ_BYTE_FIELD |
| 2388 #undef WRITE_BYTE_FIELD | 2390 #undef WRITE_BYTE_FIELD |
| 2389 | 2391 |
| 2390 | 2392 |
| 2391 } } // namespace v8::internal | 2393 } } // namespace v8::internal |
| 2392 | 2394 |
| 2393 #endif // V8_OBJECTS_INL_H_ | 2395 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |