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

Side by Side Diff: src/objects.h

Issue 268063005: Clean up hash creation code to use Handle<Smi> where possible (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « src/api.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include "allocation.h" 8 #include "allocation.h"
9 #include "assert-scope.h" 9 #include "assert-scope.h"
10 #include "builtins.h" 10 #include "builtins.h"
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 static Handle<Object> GetPrototype(Isolate* isolate, Handle<Object> object); 1495 static Handle<Object> GetPrototype(Isolate* isolate, Handle<Object> object);
1496 Map* GetMarkerMap(Isolate* isolate); 1496 Map* GetMarkerMap(Isolate* isolate);
1497 1497
1498 // Returns the permanent hash code associated with this object. May return 1498 // Returns the permanent hash code associated with this object. May return
1499 // undefined if not yet created. 1499 // undefined if not yet created.
1500 Object* GetHash(); 1500 Object* GetHash();
1501 1501
1502 // Returns the permanent hash code associated with this object depending on 1502 // Returns the permanent hash code associated with this object depending on
1503 // the actual object type. May create and store a hash code if needed and none 1503 // the actual object type. May create and store a hash code if needed and none
1504 // exists. 1504 // exists.
1505 // TODO(rafaelw): Remove isolate parameter when objects.cc is fully 1505 static Handle<Smi> GetOrCreateHash(Isolate* isolate, Handle<Object> object);
1506 // handlified.
1507 static Handle<Object> GetOrCreateHash(Handle<Object> object,
1508 Isolate* isolate);
1509 1506
1510 // Checks whether this object has the same value as the given one. This 1507 // Checks whether this object has the same value as the given one. This
1511 // function is implemented according to ES5, section 9.12 and can be used 1508 // function is implemented according to ES5, section 9.12 and can be used
1512 // to implement the Harmony "egal" function. 1509 // to implement the Harmony "egal" function.
1513 bool SameValue(Object* other); 1510 bool SameValue(Object* other);
1514 1511
1515 // Tries to convert an object to an array index. Returns true and sets 1512 // Tries to convert an object to an array index. Returns true and sets
1516 // the output parameter if it succeeds. 1513 // the output parameter if it succeeds.
1517 inline bool ToArrayIndex(uint32_t* index); 1514 inline bool ToArrayIndex(uint32_t* index);
1518 1515
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 1961
1965 // Return the constructor function (may be Heap::null_value()). 1962 // Return the constructor function (may be Heap::null_value()).
1966 inline Object* GetConstructor(); 1963 inline Object* GetConstructor();
1967 1964
1968 // Retrieves a permanent object identity hash code. The undefined value might 1965 // Retrieves a permanent object identity hash code. The undefined value might
1969 // be returned in case no hash was created yet. 1966 // be returned in case no hash was created yet.
1970 inline Object* GetIdentityHash(); 1967 inline Object* GetIdentityHash();
1971 1968
1972 // Retrieves a permanent object identity hash code. May create and store a 1969 // Retrieves a permanent object identity hash code. May create and store a
1973 // hash code if needed and none exists. 1970 // hash code if needed and none exists.
1974 inline static Handle<Object> GetOrCreateIdentityHash( 1971 inline static Handle<Smi> GetOrCreateIdentityHash(
1975 Handle<JSReceiver> object); 1972 Handle<JSReceiver> object);
1976 1973
1977 // Lookup a property. If found, the result is valid and has 1974 // Lookup a property. If found, the result is valid and has
1978 // detailed information. 1975 // detailed information.
1979 void LocalLookup(Handle<Name> name, LookupResult* result, 1976 void LocalLookup(Handle<Name> name, LookupResult* result,
1980 bool search_hidden_prototypes = false); 1977 bool search_hidden_prototypes = false);
1981 void Lookup(Handle<Name> name, LookupResult* result); 1978 void Lookup(Handle<Name> name, LookupResult* result);
1982 1979
1983 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; 1980 enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS };
1984 1981
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 Handle<JSObject> object); 2873 Handle<JSObject> object);
2877 2874
2878 // Set the hidden property backing store to either a hash table or 2875 // Set the hidden property backing store to either a hash table or
2879 // the inline-stored identity hash. 2876 // the inline-stored identity hash.
2880 static Handle<Object> SetHiddenPropertiesHashTable( 2877 static Handle<Object> SetHiddenPropertiesHashTable(
2881 Handle<JSObject> object, 2878 Handle<JSObject> object,
2882 Handle<Object> value); 2879 Handle<Object> value);
2883 2880
2884 MUST_USE_RESULT Object* GetIdentityHash(); 2881 MUST_USE_RESULT Object* GetIdentityHash();
2885 2882
2886 static Handle<Object> GetOrCreateIdentityHash(Handle<JSObject> object); 2883 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSObject> object);
2887 2884
2888 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); 2885 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject);
2889 }; 2886 };
2890 2887
2891 2888
2892 // Common superclass for FixedArrays that allow implementations to share 2889 // Common superclass for FixedArrays that allow implementations to share
2893 // common accessors and some code paths. 2890 // common accessors and some code paths.
2894 class FixedArrayBase: public HeapObject { 2891 class FixedArrayBase: public HeapObject {
2895 public: 2892 public:
2896 // [length]: length of the array. 2893 // [length]: length of the array.
(...skipping 6969 matching lines...) Expand 10 before | Expand all | Expand 10 after
9866 Handle<JSProxy> proxy, 9863 Handle<JSProxy> proxy,
9867 Handle<Name> name, 9864 Handle<Name> name,
9868 DeleteMode mode); 9865 DeleteMode mode);
9869 MUST_USE_RESULT static MaybeHandle<Object> DeleteElementWithHandler( 9866 MUST_USE_RESULT static MaybeHandle<Object> DeleteElementWithHandler(
9870 Handle<JSProxy> proxy, 9867 Handle<JSProxy> proxy,
9871 uint32_t index, 9868 uint32_t index,
9872 DeleteMode mode); 9869 DeleteMode mode);
9873 9870
9874 MUST_USE_RESULT Object* GetIdentityHash(); 9871 MUST_USE_RESULT Object* GetIdentityHash();
9875 9872
9876 static Handle<Object> GetOrCreateIdentityHash(Handle<JSProxy> proxy); 9873 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy);
9877 9874
9878 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); 9875 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy);
9879 }; 9876 };
9880 9877
9881 9878
9882 class JSFunctionProxy: public JSProxy { 9879 class JSFunctionProxy: public JSProxy {
9883 public: 9880 public:
9884 // [call_trap]: The call trap. 9881 // [call_trap]: The call trap.
9885 DECL_ACCESSORS(call_trap, Object) 9882 DECL_ACCESSORS(call_trap, Object)
9886 9883
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
11118 } else { 11115 } else {
11119 value &= ~(1 << bit_position); 11116 value &= ~(1 << bit_position);
11120 } 11117 }
11121 return value; 11118 return value;
11122 } 11119 }
11123 }; 11120 };
11124 11121
11125 } } // namespace v8::internal 11122 } } // namespace v8::internal
11126 11123
11127 #endif // V8_OBJECTS_H_ 11124 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698