Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: src/objects-inl.h

Issue 11451005: Fix spec violations related to regexp.lastIndex (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4723 matching lines...) Expand 10 before | Expand all | Expand 10 after
4734 FixedArray* fa = reinterpret_cast<FixedArray*>(data()); 4734 FixedArray* fa = reinterpret_cast<FixedArray*>(data());
4735 if (value->IsSmi()) { 4735 if (value->IsSmi()) {
4736 fa->set_unchecked(index, Smi::cast(value)); 4736 fa->set_unchecked(index, Smi::cast(value));
4737 } else { 4737 } else {
4738 // We only do this during GC, so we don't need to notify the write barrier. 4738 // We only do this during GC, so we don't need to notify the write barrier.
4739 fa->set_unchecked(heap, index, value, SKIP_WRITE_BARRIER); 4739 fa->set_unchecked(heap, index, value, SKIP_WRITE_BARRIER);
4740 } 4740 }
4741 } 4741 }
4742 4742
4743 4743
4744 void JSRegExp::ResetLastIndex() {
4745 InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
4746 Smi::FromInt(0),
4747 SKIP_WRITE_BARRIER); // It's a Smi.
4748 }
4749
4750
4744 ElementsKind JSObject::GetElementsKind() { 4751 ElementsKind JSObject::GetElementsKind() {
4745 ElementsKind kind = map()->elements_kind(); 4752 ElementsKind kind = map()->elements_kind();
4746 #if DEBUG 4753 #if DEBUG
4747 FixedArrayBase* fixed_array = 4754 FixedArrayBase* fixed_array =
4748 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); 4755 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset));
4749 Map* map = fixed_array->map(); 4756 Map* map = fixed_array->map();
4750 ASSERT((IsFastSmiOrObjectElementsKind(kind) && 4757 ASSERT((IsFastSmiOrObjectElementsKind(kind) &&
4751 (map == GetHeap()->fixed_array_map() || 4758 (map == GetHeap()->fixed_array_map() ||
4752 map == GetHeap()->fixed_cow_array_map())) || 4759 map == GetHeap()->fixed_cow_array_map())) ||
4753 (IsFastDoubleElementsKind(kind) && 4760 (IsFastDoubleElementsKind(kind) &&
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
5546 #undef WRITE_UINT32_FIELD 5553 #undef WRITE_UINT32_FIELD
5547 #undef READ_SHORT_FIELD 5554 #undef READ_SHORT_FIELD
5548 #undef WRITE_SHORT_FIELD 5555 #undef WRITE_SHORT_FIELD
5549 #undef READ_BYTE_FIELD 5556 #undef READ_BYTE_FIELD
5550 #undef WRITE_BYTE_FIELD 5557 #undef WRITE_BYTE_FIELD
5551 5558
5552 5559
5553 } } // namespace v8::internal 5560 } } // namespace v8::internal
5554 5561
5555 #endif // V8_OBJECTS_INL_H_ 5562 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698