| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5068 FixedArray* fa = reinterpret_cast<FixedArray*>(data()); | 5068 FixedArray* fa = reinterpret_cast<FixedArray*>(data()); |
| 5069 if (value->IsSmi()) { | 5069 if (value->IsSmi()) { |
| 5070 fa->set_unchecked(index, Smi::cast(value)); | 5070 fa->set_unchecked(index, Smi::cast(value)); |
| 5071 } else { | 5071 } else { |
| 5072 // We only do this during GC, so we don't need to notify the write barrier. | 5072 // We only do this during GC, so we don't need to notify the write barrier. |
| 5073 fa->set_unchecked(heap, index, value, SKIP_WRITE_BARRIER); | 5073 fa->set_unchecked(heap, index, value, SKIP_WRITE_BARRIER); |
| 5074 } | 5074 } |
| 5075 } | 5075 } |
| 5076 | 5076 |
| 5077 | 5077 |
| 5078 void JSRegExp::ResetLastIndex(Isolate* isolate, | |
| 5079 Handle<JSRegExp> regexp) { | |
| 5080 // Reset lastIndex property to 0. | |
| 5081 SetProperty(regexp, | |
| 5082 isolate->factory()->last_index_symbol(), | |
| 5083 Handle<Smi>(Smi::FromInt(0)), | |
| 5084 ::NONE, | |
| 5085 kNonStrictMode); | |
| 5086 } | |
| 5087 | |
| 5088 | |
| 5089 ElementsKind JSObject::GetElementsKind() { | 5078 ElementsKind JSObject::GetElementsKind() { |
| 5090 ElementsKind kind = map()->elements_kind(); | 5079 ElementsKind kind = map()->elements_kind(); |
| 5091 #if DEBUG | 5080 #if DEBUG |
| 5092 FixedArrayBase* fixed_array = | 5081 FixedArrayBase* fixed_array = |
| 5093 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); | 5082 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); |
| 5094 Map* map = fixed_array->map(); | 5083 Map* map = fixed_array->map(); |
| 5095 ASSERT((IsFastSmiOrObjectElementsKind(kind) && | 5084 ASSERT((IsFastSmiOrObjectElementsKind(kind) && |
| 5096 (map == GetHeap()->fixed_array_map() || | 5085 (map == GetHeap()->fixed_array_map() || |
| 5097 map == GetHeap()->fixed_cow_array_map())) || | 5086 map == GetHeap()->fixed_cow_array_map())) || |
| 5098 (IsFastDoubleElementsKind(kind) && | 5087 (IsFastDoubleElementsKind(kind) && |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5887 #undef WRITE_UINT32_FIELD | 5876 #undef WRITE_UINT32_FIELD |
| 5888 #undef READ_SHORT_FIELD | 5877 #undef READ_SHORT_FIELD |
| 5889 #undef WRITE_SHORT_FIELD | 5878 #undef WRITE_SHORT_FIELD |
| 5890 #undef READ_BYTE_FIELD | 5879 #undef READ_BYTE_FIELD |
| 5891 #undef WRITE_BYTE_FIELD | 5880 #undef WRITE_BYTE_FIELD |
| 5892 | 5881 |
| 5893 | 5882 |
| 5894 } } // namespace v8::internal | 5883 } } // namespace v8::internal |
| 5895 | 5884 |
| 5896 #endif // V8_OBJECTS_INL_H_ | 5885 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |