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

Side by Side Diff: src/objects.h

Issue 8895025: Fix invalid usage of StoreIC_ArrayLength optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. Created 9 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/mips/ic-mips.cc ('k') | 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 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 inline bool HasExternalByteElements(); 1464 inline bool HasExternalByteElements();
1465 inline bool HasExternalUnsignedByteElements(); 1465 inline bool HasExternalUnsignedByteElements();
1466 inline bool HasExternalShortElements(); 1466 inline bool HasExternalShortElements();
1467 inline bool HasExternalUnsignedShortElements(); 1467 inline bool HasExternalUnsignedShortElements();
1468 inline bool HasExternalIntElements(); 1468 inline bool HasExternalIntElements();
1469 inline bool HasExternalUnsignedIntElements(); 1469 inline bool HasExternalUnsignedIntElements();
1470 inline bool HasExternalFloatElements(); 1470 inline bool HasExternalFloatElements();
1471 inline bool HasExternalDoubleElements(); 1471 inline bool HasExternalDoubleElements();
1472 bool HasFastArgumentsElements(); 1472 bool HasFastArgumentsElements();
1473 bool HasDictionaryArgumentsElements(); 1473 bool HasDictionaryArgumentsElements();
1474 inline bool AllowsSetElementsLength();
1475 inline NumberDictionary* element_dictionary(); // Gets slow elements. 1474 inline NumberDictionary* element_dictionary(); // Gets slow elements.
1476 1475
1477 // Requires: HasFastElements(). 1476 // Requires: HasFastElements().
1478 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); 1477 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
1479 1478
1480 // Collects elements starting at index 0. 1479 // Collects elements starting at index 0.
1481 // Undefined values are placed after non-undefined values. 1480 // Undefined values are placed after non-undefined values.
1482 // Returns the number of non-undefined values. 1481 // Returns the number of non-undefined values.
1483 MUST_USE_RESULT MaybeObject* PrepareElementsForSort(uint32_t limit); 1482 MUST_USE_RESULT MaybeObject* PrepareElementsForSort(uint32_t limit);
1484 // As PrepareElementsForSort, but only on objects where elements is 1483 // As PrepareElementsForSort, but only on objects where elements is
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 // Lookup interceptors are used for handling properties controlled by host 1725 // Lookup interceptors are used for handling properties controlled by host
1727 // objects. 1726 // objects.
1728 inline bool HasNamedInterceptor(); 1727 inline bool HasNamedInterceptor();
1729 inline bool HasIndexedInterceptor(); 1728 inline bool HasIndexedInterceptor();
1730 1729
1731 // Support functions for v8 api (needed for correct interceptor behavior). 1730 // Support functions for v8 api (needed for correct interceptor behavior).
1732 bool HasRealNamedProperty(String* key); 1731 bool HasRealNamedProperty(String* key);
1733 bool HasRealElementProperty(uint32_t index); 1732 bool HasRealElementProperty(uint32_t index);
1734 bool HasRealNamedCallbackProperty(String* key); 1733 bool HasRealNamedCallbackProperty(String* key);
1735 1734
1736 // Initializes the array to a certain length
1737 MUST_USE_RESULT MaybeObject* SetElementsLength(Object* length);
1738
1739 // Get the header size for a JSObject. Used to compute the index of 1735 // Get the header size for a JSObject. Used to compute the index of
1740 // internal fields as well as the number of internal fields. 1736 // internal fields as well as the number of internal fields.
1741 inline int GetHeaderSize(); 1737 inline int GetHeaderSize();
1742 1738
1743 inline int GetInternalFieldCount(); 1739 inline int GetInternalFieldCount();
1744 inline int GetInternalFieldOffset(int index); 1740 inline int GetInternalFieldOffset(int index);
1745 inline Object* GetInternalField(int index); 1741 inline Object* GetInternalField(int index);
1746 inline void SetInternalField(int index, Object* value); 1742 inline void SetInternalField(int index, Object* value);
1747 inline void SetInternalField(int index, Smi* value); 1743 inline void SetInternalField(int index, Smi* value);
1748 1744
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
7391 inline void set_length(Smi* length); 7387 inline void set_length(Smi* length);
7392 7388
7393 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index, 7389 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index,
7394 Object* value); 7390 Object* value);
7395 7391
7396 // Initialize the array with the given capacity. The function may 7392 // Initialize the array with the given capacity. The function may
7397 // fail due to out-of-memory situations, but only if the requested 7393 // fail due to out-of-memory situations, but only if the requested
7398 // capacity is non-zero. 7394 // capacity is non-zero.
7399 MUST_USE_RESULT MaybeObject* Initialize(int capacity); 7395 MUST_USE_RESULT MaybeObject* Initialize(int capacity);
7400 7396
7397 // Initializes the array to a certain length.
7398 inline bool AllowsSetElementsLength();
7399 MUST_USE_RESULT MaybeObject* SetElementsLength(Object* length);
7400
7401 // Set the content of the array to the content of storage. 7401 // Set the content of the array to the content of storage.
7402 inline MaybeObject* SetContent(FixedArrayBase* storage); 7402 inline MaybeObject* SetContent(FixedArrayBase* storage);
7403 7403
7404 // Casting. 7404 // Casting.
7405 static inline JSArray* cast(Object* obj); 7405 static inline JSArray* cast(Object* obj);
7406 7406
7407 // Uses handles. Ensures that the fixed array backing the JSArray has at 7407 // Uses handles. Ensures that the fixed array backing the JSArray has at
7408 // least the stated size. 7408 // least the stated size.
7409 inline void EnsureSize(int minimum_size_of_backing_fixed_array); 7409 inline void EnsureSize(int minimum_size_of_backing_fixed_array);
7410 7410
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
8001 } else { 8001 } else {
8002 value &= ~(1 << bit_position); 8002 value &= ~(1 << bit_position);
8003 } 8003 }
8004 return value; 8004 return value;
8005 } 8005 }
8006 }; 8006 };
8007 8007
8008 } } // namespace v8::internal 8008 } } // namespace v8::internal
8009 8009
8010 #endif // V8_OBJECTS_H_ 8010 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/ic-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698