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

Side by Side Diff: src/objects.h

Issue 7617010: Change JSObject elements to be of type FixedArrayBase (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 4 months 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 | « no previous file | src/objects.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 inline bool name(); \ 628 inline bool name(); \
629 inline void set_##name(bool value); \ 629 inline void set_##name(bool value); \
630 630
631 631
632 #define DECL_ACCESSORS(name, type) \ 632 #define DECL_ACCESSORS(name, type) \
633 inline type* name(); \ 633 inline type* name(); \
634 inline void set_##name(type* value, \ 634 inline void set_##name(type* value, \
635 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \ 635 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
636 636
637 637
638 class DictionaryElementsAccessor;
638 class ElementsAccessor; 639 class ElementsAccessor;
640 class FixedArrayBase;
641 class ObjectVisitor;
639 class StringStream; 642 class StringStream;
640 class ObjectVisitor;
641 class DictionaryElementsAccessor;
642 643
643 struct ValueInfo : public Malloced { 644 struct ValueInfo : public Malloced {
644 ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { } 645 ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { }
645 InstanceType type; 646 InstanceType type;
646 Object* ptr; 647 Object* ptr;
647 const char* str; 648 const char* str;
648 double number; 649 double number;
649 }; 650 };
650 651
651 652
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 // elements array can have one of three maps in this mode: 1487 // elements array can have one of three maps in this mode:
1487 // fixed_array_map, non_strict_arguments_elements_map or 1488 // fixed_array_map, non_strict_arguments_elements_map or
1488 // fixed_cow_array_map (for copy-on-write arrays). In the latter case 1489 // fixed_cow_array_map (for copy-on-write arrays). In the latter case
1489 // the elements array may be shared by a few objects and so before 1490 // the elements array may be shared by a few objects and so before
1490 // writing to any element the array must be copied. Use 1491 // writing to any element the array must be copied. Use
1491 // EnsureWritableFastElements in this case. 1492 // EnsureWritableFastElements in this case.
1492 // 1493 //
1493 // In the slow mode the elements is either a NumberDictionary, an 1494 // In the slow mode the elements is either a NumberDictionary, an
1494 // ExternalArray, or a FixedArray parameter map for a (non-strict) 1495 // ExternalArray, or a FixedArray parameter map for a (non-strict)
1495 // arguments object. 1496 // arguments object.
1496 DECL_ACCESSORS(elements, HeapObject) 1497 DECL_ACCESSORS(elements, FixedArrayBase)
1497 inline void initialize_elements(); 1498 inline void initialize_elements();
1498 MUST_USE_RESULT inline MaybeObject* ResetElements(); 1499 MUST_USE_RESULT inline MaybeObject* ResetElements();
1499 inline ElementsKind GetElementsKind(); 1500 inline ElementsKind GetElementsKind();
1500 inline ElementsAccessor* GetElementsAccessor(); 1501 inline ElementsAccessor* GetElementsAccessor();
1501 inline bool HasFastElements(); 1502 inline bool HasFastElements();
1502 inline bool HasFastDoubleElements(); 1503 inline bool HasFastDoubleElements();
1503 inline bool HasDictionaryElements(); 1504 inline bool HasDictionaryElements();
1504 inline bool HasExternalPixelElements(); 1505 inline bool HasExternalPixelElements();
1505 inline bool HasExternalArrayElements(); 1506 inline bool HasExternalArrayElements();
1506 inline bool HasExternalByteElements(); 1507 inline bool HasExternalByteElements();
(...skipping 5804 matching lines...) Expand 10 before | Expand all | Expand 10 after
7311 } else { 7312 } else {
7312 value &= ~(1 << bit_position); 7313 value &= ~(1 << bit_position);
7313 } 7314 }
7314 return value; 7315 return value;
7315 } 7316 }
7316 }; 7317 };
7317 7318
7318 } } // namespace v8::internal 7319 } } // namespace v8::internal
7319 7320
7320 #endif // V8_OBJECTS_H_ 7321 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698