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

Side by Side Diff: src/objects.h

Issue 153773002: A64: Synchronize with r16679. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/object-observe.js ('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 // 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 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 PropertyAttributes attributes, 2196 PropertyAttributes attributes,
2197 StrictModeFlag strict_mode, 2197 StrictModeFlag strict_mode,
2198 StoreMode mode = ALLOW_AS_CONSTANT); 2198 StoreMode mode = ALLOW_AS_CONSTANT);
2199 2199
2200 static Handle<Object> SetLocalPropertyIgnoreAttributes( 2200 static Handle<Object> SetLocalPropertyIgnoreAttributes(
2201 Handle<JSObject> object, 2201 Handle<JSObject> object,
2202 Handle<Name> key, 2202 Handle<Name> key,
2203 Handle<Object> value, 2203 Handle<Object> value,
2204 PropertyAttributes attributes, 2204 PropertyAttributes attributes,
2205 ValueType value_type = OPTIMAL_REPRESENTATION, 2205 ValueType value_type = OPTIMAL_REPRESENTATION,
2206 StoreMode mode = ALLOW_AS_CONSTANT); 2206 StoreMode mode = ALLOW_AS_CONSTANT,
2207 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK);
2207 2208
2208 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map); 2209 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map);
2209 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map); 2210 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map);
2210 2211
2211 // Try to follow an existing transition to a field with attributes NONE. The 2212 // Try to follow an existing transition to a field with attributes NONE. The
2212 // return value indicates whether the transition was successful. 2213 // return value indicates whether the transition was successful.
2213 static inline Handle<Map> FindTransitionToField(Handle<Map> map, 2214 static inline Handle<Map> FindTransitionToField(Handle<Map> map,
2214 Handle<Name> key); 2215 Handle<Name> key);
2215 2216
2216 inline int LastAddedFieldIndex(); 2217 inline int LastAddedFieldIndex();
(...skipping 10 matching lines...) Expand all
2227 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance(); 2228 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance();
2228 2229
2229 // Can cause GC. 2230 // Can cause GC.
2230 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( 2231 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
2231 Name* key, 2232 Name* key,
2232 Object* value, 2233 Object* value,
2233 PropertyAttributes attributes, 2234 PropertyAttributes attributes,
2234 ValueType value_type = OPTIMAL_REPRESENTATION, 2235 ValueType value_type = OPTIMAL_REPRESENTATION,
2235 StoreMode mode = ALLOW_AS_CONSTANT, 2236 StoreMode mode = ALLOW_AS_CONSTANT,
2236 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK); 2237 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK);
2238 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributesTrampoline(
2239 Name* key,
2240 Object* value,
2241 PropertyAttributes attributes,
2242 ValueType value_type = OPTIMAL_REPRESENTATION,
2243 StoreMode mode = ALLOW_AS_CONSTANT,
2244 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK);
2237 2245
2238 // Retrieve a value in a normalized object given a lookup result. 2246 // Retrieve a value in a normalized object given a lookup result.
2239 // Handles the special representation of JS global objects. 2247 // Handles the special representation of JS global objects.
2240 Object* GetNormalizedProperty(LookupResult* result); 2248 Object* GetNormalizedProperty(LookupResult* result);
2241 2249
2242 // Sets the property value in a normalized object given (key, value). 2250 // Sets the property value in a normalized object given (key, value).
2243 // Handles the special representation of JS global objects. 2251 // Handles the special representation of JS global objects.
2244 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, 2252 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object,
2245 LookupResult* result, 2253 LookupResult* result,
2246 Handle<Object> value); 2254 Handle<Object> value);
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3498 // Maximal capacity of HashTable. Based on maximal length of underlying 3506 // Maximal capacity of HashTable. Based on maximal length of underlying
3499 // FixedArray. Staying below kMaxCapacity also ensures that EntryToIndex 3507 // FixedArray. Staying below kMaxCapacity also ensures that EntryToIndex
3500 // cannot overflow. 3508 // cannot overflow.
3501 static const int kMaxCapacity = 3509 static const int kMaxCapacity =
3502 (FixedArray::kMaxLength - kElementsStartOffset) / kEntrySize; 3510 (FixedArray::kMaxLength - kElementsStartOffset) / kEntrySize;
3503 3511
3504 // Find entry for key otherwise return kNotFound. 3512 // Find entry for key otherwise return kNotFound.
3505 inline int FindEntry(Key key); 3513 inline int FindEntry(Key key);
3506 int FindEntry(Isolate* isolate, Key key); 3514 int FindEntry(Isolate* isolate, Key key);
3507 3515
3516 // Rehashes the table in-place.
3517 void Rehash(Key key);
3518
3508 protected: 3519 protected:
3509 // Find the entry at which to insert element with the given key that 3520 // Find the entry at which to insert element with the given key that
3510 // has the given hash value. 3521 // has the given hash value.
3511 uint32_t FindInsertionEntry(uint32_t hash); 3522 uint32_t FindInsertionEntry(uint32_t hash);
3512 3523
3513 // Returns the index for an entry (of the key) 3524 // Returns the index for an entry (of the key)
3514 static inline int EntryToIndex(int entry) { 3525 static inline int EntryToIndex(int entry) {
3515 return (entry * kEntrySize) + kElementsStartIndex; 3526 return (entry * kEntrySize) + kElementsStartIndex;
3516 } 3527 }
3517 3528
(...skipping 26 matching lines...) Expand all
3544 3555
3545 inline static uint32_t FirstProbe(uint32_t hash, uint32_t size) { 3556 inline static uint32_t FirstProbe(uint32_t hash, uint32_t size) {
3546 return hash & (size - 1); 3557 return hash & (size - 1);
3547 } 3558 }
3548 3559
3549 inline static uint32_t NextProbe( 3560 inline static uint32_t NextProbe(
3550 uint32_t last, uint32_t number, uint32_t size) { 3561 uint32_t last, uint32_t number, uint32_t size) {
3551 return (last + number) & (size - 1); 3562 return (last + number) & (size - 1);
3552 } 3563 }
3553 3564
3565 // Returns _expected_ if one of entries given by the first _probe_ probes is
3566 // equal to _expected_. Otherwise, returns the entry given by the probe
3567 // number _probe_.
3568 uint32_t EntryForProbe(Key key, Object* k, int probe, uint32_t expected);
3569
3570 void Swap(uint32_t entry1, uint32_t entry2, WriteBarrierMode mode);
3571
3554 // Rehashes this hash-table into the new table. 3572 // Rehashes this hash-table into the new table.
3555 MUST_USE_RESULT MaybeObject* Rehash(HashTable* new_table, Key key); 3573 MUST_USE_RESULT MaybeObject* Rehash(HashTable* new_table, Key key);
3556 3574
3557 // Attempt to shrink hash table after removal of key. 3575 // Attempt to shrink hash table after removal of key.
3558 MUST_USE_RESULT MaybeObject* Shrink(Key key); 3576 MUST_USE_RESULT MaybeObject* Shrink(Key key);
3559 3577
3560 // Ensure enough space for n additional elements. 3578 // Ensure enough space for n additional elements.
3561 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key); 3579 MUST_USE_RESULT MaybeObject* EnsureCapacity(int n, Key key);
3562 }; 3580 };
3563 3581
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
4660 4678
4661 void SetAstId(int i, BailoutId value) { 4679 void SetAstId(int i, BailoutId value) {
4662 SetAstIdRaw(i, Smi::FromInt(value.ToInt())); 4680 SetAstIdRaw(i, Smi::FromInt(value.ToInt()));
4663 } 4681 }
4664 4682
4665 int DeoptCount() { 4683 int DeoptCount() {
4666 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize; 4684 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
4667 } 4685 }
4668 4686
4669 // Allocates a DeoptimizationInputData. 4687 // Allocates a DeoptimizationInputData.
4670 MUST_USE_RESULT static MaybeObject* Allocate(int deopt_entry_count, 4688 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate,
4689 int deopt_entry_count,
4671 PretenureFlag pretenure); 4690 PretenureFlag pretenure);
4672 4691
4673 // Casting. 4692 // Casting.
4674 static inline DeoptimizationInputData* cast(Object* obj); 4693 static inline DeoptimizationInputData* cast(Object* obj);
4675 4694
4676 #ifdef ENABLE_DISASSEMBLER 4695 #ifdef ENABLE_DISASSEMBLER
4677 void DeoptimizationInputDataPrint(FILE* out); 4696 void DeoptimizationInputDataPrint(FILE* out);
4678 #endif 4697 #endif
4679 4698
4680 private: 4699 private:
(...skipping 25 matching lines...) Expand all
4706 } 4725 }
4707 4726
4708 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); } 4727 Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); }
4709 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); } 4728 void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); }
4710 4729
4711 static int LengthOfFixedArray(int deopt_points) { 4730 static int LengthOfFixedArray(int deopt_points) {
4712 return deopt_points * 2; 4731 return deopt_points * 2;
4713 } 4732 }
4714 4733
4715 // Allocates a DeoptimizationOutputData. 4734 // Allocates a DeoptimizationOutputData.
4716 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_deopt_points, 4735 MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate,
4736 int number_of_deopt_points,
4717 PretenureFlag pretenure); 4737 PretenureFlag pretenure);
4718 4738
4719 // Casting. 4739 // Casting.
4720 static inline DeoptimizationOutputData* cast(Object* obj); 4740 static inline DeoptimizationOutputData* cast(Object* obj);
4721 4741
4722 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER) 4742 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER)
4723 void DeoptimizationOutputDataPrint(FILE* out); 4743 void DeoptimizationOutputDataPrint(FILE* out);
4724 #endif 4744 #endif
4725 }; 4745 };
4726 4746
(...skipping 5527 matching lines...) Expand 10 before | Expand all | Expand 10 after
10254 } else { 10274 } else {
10255 value &= ~(1 << bit_position); 10275 value &= ~(1 << bit_position);
10256 } 10276 }
10257 return value; 10277 return value;
10258 } 10278 }
10259 }; 10279 };
10260 10280
10261 } } // namespace v8::internal 10281 } } // namespace v8::internal
10262 10282
10263 #endif // V8_OBJECTS_H_ 10283 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698