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 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2309 | 2309 |
| 2310 | 2310 |
| 2311 JSRegExp::Type JSRegExp::TypeTag() { | 2311 JSRegExp::Type JSRegExp::TypeTag() { |
| 2312 Object* data = this->data(); | 2312 Object* data = this->data(); |
| 2313 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; | 2313 if (data->IsUndefined()) return JSRegExp::NOT_COMPILED; |
| 2314 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); | 2314 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kTagIndex)); |
| 2315 return static_cast<JSRegExp::Type>(smi->value()); | 2315 return static_cast<JSRegExp::Type>(smi->value()); |
| 2316 } | 2316 } |
| 2317 | 2317 |
| 2318 | 2318 |
| 2319 int JSRegExp::CaptureCount() { | |
| 2320 switch (TypeTag()) { | |
| 2321 case ATOM: return 0; | |
|
Erik Corry
2009/03/12 10:13:00
Indentation is wrong here.
Lasse Reichstein
2009/03/13 08:36:51
Done.
| |
| 2322 case IRREGEXP: return Smi::cast(DataAt(kIrregexpCaptureCountIndex))->value(); | |
| 2323 default: | |
| 2324 UNREACHABLE(); | |
| 2325 return -1; | |
| 2326 } | |
| 2327 } | |
| 2328 | |
| 2329 | |
| 2319 JSRegExp::Flags JSRegExp::GetFlags() { | 2330 JSRegExp::Flags JSRegExp::GetFlags() { |
| 2320 ASSERT(this->data()->IsFixedArray()); | 2331 ASSERT(this->data()->IsFixedArray()); |
| 2321 Object* data = this->data(); | 2332 Object* data = this->data(); |
| 2322 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kFlagsIndex)); | 2333 Smi* smi = Smi::cast(FixedArray::cast(data)->get(kFlagsIndex)); |
| 2323 return Flags(smi->value()); | 2334 return Flags(smi->value()); |
| 2324 } | 2335 } |
| 2325 | 2336 |
| 2326 | 2337 |
| 2327 String* JSRegExp::Pattern() { | 2338 String* JSRegExp::Pattern() { |
| 2328 ASSERT(this->data()->IsFixedArray()); | 2339 ASSERT(this->data()->IsFixedArray()); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2560 #undef WRITE_INT_FIELD | 2571 #undef WRITE_INT_FIELD |
| 2561 #undef READ_SHORT_FIELD | 2572 #undef READ_SHORT_FIELD |
| 2562 #undef WRITE_SHORT_FIELD | 2573 #undef WRITE_SHORT_FIELD |
| 2563 #undef READ_BYTE_FIELD | 2574 #undef READ_BYTE_FIELD |
| 2564 #undef WRITE_BYTE_FIELD | 2575 #undef WRITE_BYTE_FIELD |
| 2565 | 2576 |
| 2566 | 2577 |
| 2567 } } // namespace v8::internal | 2578 } } // namespace v8::internal |
| 2568 | 2579 |
| 2569 #endif // V8_OBJECTS_INL_H_ | 2580 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |