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

Side by Side Diff: src/objects.h

Issue 149133004: A64: Synchronize with r17807. (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/mips/stub-cache-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 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 V(CONS_INTERNALIZED_STRING_TYPE) \ 347 V(CONS_INTERNALIZED_STRING_TYPE) \
348 V(CONS_ASCII_INTERNALIZED_STRING_TYPE) \ 348 V(CONS_ASCII_INTERNALIZED_STRING_TYPE) \
349 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \ 349 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \
350 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ 350 V(EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \
351 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ 351 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
352 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \ 352 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \
353 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \ 353 V(SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE) \
354 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \ 354 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
355 \ 355 \
356 V(SYMBOL_TYPE) \ 356 V(SYMBOL_TYPE) \
357 \
357 V(MAP_TYPE) \ 358 V(MAP_TYPE) \
358 V(CODE_TYPE) \ 359 V(CODE_TYPE) \
359 V(ODDBALL_TYPE) \ 360 V(ODDBALL_TYPE) \
360 V(CELL_TYPE) \ 361 V(CELL_TYPE) \
361 V(PROPERTY_CELL_TYPE) \ 362 V(PROPERTY_CELL_TYPE) \
362 \ 363 \
363 V(HEAP_NUMBER_TYPE) \ 364 V(HEAP_NUMBER_TYPE) \
364 V(FOREIGN_TYPE) \ 365 V(FOREIGN_TYPE) \
365 V(BYTE_ARRAY_TYPE) \ 366 V(BYTE_ARRAY_TYPE) \
366 V(FREE_SPACE_TYPE) \ 367 V(FREE_SPACE_TYPE) \
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 | kNotInternalizedTag, 680 | kNotInternalizedTag,
680 SHORT_EXTERNAL_STRING_TYPE = 681 SHORT_EXTERNAL_STRING_TYPE =
681 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, 682 SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE | kNotInternalizedTag,
682 SHORT_EXTERNAL_ASCII_STRING_TYPE = 683 SHORT_EXTERNAL_ASCII_STRING_TYPE =
683 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag, 684 SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE | kNotInternalizedTag,
684 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE = 685 SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE =
685 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE 686 SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE
686 | kNotInternalizedTag, 687 | kNotInternalizedTag,
687 688
688 // Non-string names 689 // Non-string names
689 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE 690 SYMBOL_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE, LAST_NAME_TYPE
690 691
691 // Objects allocated in their own spaces (never in new space). 692 // Objects allocated in their own spaces (never in new space).
692 MAP_TYPE, 693 MAP_TYPE,
693 CODE_TYPE, 694 CODE_TYPE,
694 ODDBALL_TYPE, 695 ODDBALL_TYPE,
695 CELL_TYPE, 696 CELL_TYPE,
696 PROPERTY_CELL_TYPE, 697 PROPERTY_CELL_TYPE,
697 698
698 // "Data", objects that cannot contain non-map-word pointers to heap 699 // "Data", objects that cannot contain non-map-word pointers to heap
699 // objects. 700 // objects.
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 MUST_USE_RESULT inline MaybeObject* GetElement(Isolate* isolate, 1528 MUST_USE_RESULT inline MaybeObject* GetElement(Isolate* isolate,
1528 uint32_t index); 1529 uint32_t index);
1529 // For use when we know that no exception can be thrown. 1530 // For use when we know that no exception can be thrown.
1530 inline Object* GetElementNoExceptionThrown(Isolate* isolate, uint32_t index); 1531 inline Object* GetElementNoExceptionThrown(Isolate* isolate, uint32_t index);
1531 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Isolate* isolate, 1532 MUST_USE_RESULT MaybeObject* GetElementWithReceiver(Isolate* isolate,
1532 Object* receiver, 1533 Object* receiver,
1533 uint32_t index); 1534 uint32_t index);
1534 1535
1535 // Return the object's prototype (might be Heap::null_value()). 1536 // Return the object's prototype (might be Heap::null_value()).
1536 Object* GetPrototype(Isolate* isolate); 1537 Object* GetPrototype(Isolate* isolate);
1538 Map* GetMarkerMap(Isolate* isolate);
1537 1539
1538 // Returns the permanent hash code associated with this object. May return 1540 // Returns the permanent hash code associated with this object. May return
1539 // undefined if not yet created. 1541 // undefined if not yet created.
1540 Object* GetHash(); 1542 Object* GetHash();
1541 1543
1542 // Returns the permanent hash code associated with this object depending on 1544 // Returns the permanent hash code associated with this object depending on
1543 // the actual object type. May create and store a hash code if needed and none 1545 // the actual object type. May create and store a hash code if needed and none
1544 // exists. 1546 // exists.
1545 // TODO(rafaelw): Remove isolate parameter when objects.cc is fully 1547 // TODO(rafaelw): Remove isolate parameter when objects.cc is fully
1546 // handlified. 1548 // handlified.
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2371 // Computes the new capacity when expanding the elements of a JSObject. 2373 // Computes the new capacity when expanding the elements of a JSObject.
2372 static int NewElementsCapacity(int old_capacity) { 2374 static int NewElementsCapacity(int old_capacity) {
2373 // (old_capacity + 50%) + 16 2375 // (old_capacity + 50%) + 16
2374 return old_capacity + (old_capacity >> 1) + 16; 2376 return old_capacity + (old_capacity >> 1) + 16;
2375 } 2377 }
2376 2378
2377 // These methods do not perform access checks! 2379 // These methods do not perform access checks!
2378 AccessorPair* GetLocalPropertyAccessorPair(Name* name); 2380 AccessorPair* GetLocalPropertyAccessorPair(Name* name);
2379 AccessorPair* GetLocalElementAccessorPair(uint32_t index); 2381 AccessorPair* GetLocalElementAccessorPair(uint32_t index);
2380 2382
2381 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, 2383 static Handle<Object> SetFastElement(Handle<JSObject> object, uint32_t index,
2382 Object* value, 2384 Handle<Object> value,
2383 StrictModeFlag strict_mode, 2385 StrictModeFlag strict_mode,
2384 bool check_prototype); 2386 bool check_prototype);
2385
2386 MUST_USE_RESULT MaybeObject* SetDictionaryElement(
2387 uint32_t index,
2388 Object* value,
2389 PropertyAttributes attributes,
2390 StrictModeFlag strict_mode,
2391 bool check_prototype,
2392 SetPropertyMode set_mode = SET_PROPERTY);
2393
2394 MUST_USE_RESULT MaybeObject* SetFastDoubleElement(
2395 uint32_t index,
2396 Object* value,
2397 StrictModeFlag strict_mode,
2398 bool check_prototype = true);
2399 2387
2400 static Handle<Object> SetOwnElement(Handle<JSObject> object, 2388 static Handle<Object> SetOwnElement(Handle<JSObject> object,
2401 uint32_t index, 2389 uint32_t index,
2402 Handle<Object> value, 2390 Handle<Object> value,
2403 StrictModeFlag strict_mode); 2391 StrictModeFlag strict_mode);
2404 2392
2405 // Empty handle is returned if the element cannot be set to the given value. 2393 // Empty handle is returned if the element cannot be set to the given value.
2406 static Handle<Object> SetElement( 2394 static Handle<Object> SetElement(
2407 Handle<JSObject> object, 2395 Handle<JSObject> object,
2408 uint32_t index, 2396 uint32_t index,
2409 Handle<Object> value, 2397 Handle<Object> value,
2410 PropertyAttributes attr,
2411 StrictModeFlag strict_mode,
2412 bool check_prototype = true,
2413 SetPropertyMode set_mode = SET_PROPERTY);
2414
2415 // A Failure object is returned if GC is needed.
2416 MUST_USE_RESULT MaybeObject* SetElement(
2417 uint32_t index,
2418 Object* value,
2419 PropertyAttributes attributes, 2398 PropertyAttributes attributes,
2420 StrictModeFlag strict_mode, 2399 StrictModeFlag strict_mode,
2421 bool check_prototype = true, 2400 bool check_prototype = true,
2422 SetPropertyMode set_mode = SET_PROPERTY); 2401 SetPropertyMode set_mode = SET_PROPERTY);
2423 2402
2424 // Returns the index'th element. 2403 // Returns the index'th element.
2425 // The undefined object if index is out of bounds. 2404 // The undefined object if index is out of bounds.
2426 MUST_USE_RESULT MaybeObject* GetElementWithInterceptor(Object* receiver, 2405 MUST_USE_RESULT MaybeObject* GetElementWithInterceptor(Object* receiver,
2427 uint32_t index); 2406 uint32_t index);
2428 2407
2429 enum SetFastElementsCapacitySmiMode { 2408 enum SetFastElementsCapacitySmiMode {
2430 kAllowSmiElements, 2409 kAllowSmiElements,
2431 kForceSmiElements, 2410 kForceSmiElements,
2432 kDontAllowSmiElements 2411 kDontAllowSmiElements
2433 }; 2412 };
2434 2413
2414 static Handle<FixedArray> SetFastElementsCapacityAndLength(
2415 Handle<JSObject> object,
2416 int capacity,
2417 int length,
2418 SetFastElementsCapacitySmiMode smi_mode);
2435 // Replace the elements' backing store with fast elements of the given 2419 // Replace the elements' backing store with fast elements of the given
2436 // capacity. Update the length for JSArrays. Returns the new backing 2420 // capacity. Update the length for JSArrays. Returns the new backing
2437 // store. 2421 // store.
2438 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength( 2422 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(
2439 int capacity, 2423 int capacity,
2440 int length, 2424 int length,
2441 SetFastElementsCapacitySmiMode smi_mode); 2425 SetFastElementsCapacitySmiMode smi_mode);
2426 static void SetFastDoubleElementsCapacityAndLength(
2427 Handle<JSObject> object,
2428 int capacity,
2429 int length);
2442 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength( 2430 MUST_USE_RESULT MaybeObject* SetFastDoubleElementsCapacityAndLength(
2443 int capacity, 2431 int capacity,
2444 int length); 2432 int length);
2445 2433
2446 // Lookup interceptors are used for handling properties controlled by host 2434 // Lookup interceptors are used for handling properties controlled by host
2447 // objects. 2435 // objects.
2448 inline bool HasNamedInterceptor(); 2436 inline bool HasNamedInterceptor();
2449 inline bool HasIndexedInterceptor(); 2437 inline bool HasIndexedInterceptor();
2450 2438
2451 // Support functions for v8 api (needed for correct interceptor behavior). 2439 // Support functions for v8 api (needed for correct interceptor behavior).
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( 2489 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap(
2502 Isolate* isolate, 2490 Isolate* isolate,
2503 ElementsKind elements_kind); 2491 ElementsKind elements_kind);
2504 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( 2492 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow(
2505 ElementsKind elements_kind); 2493 ElementsKind elements_kind);
2506 2494
2507 static void TransitionElementsKind(Handle<JSObject> object, 2495 static void TransitionElementsKind(Handle<JSObject> object,
2508 ElementsKind to_kind); 2496 ElementsKind to_kind);
2509 2497
2510 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); 2498 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind);
2511 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind);
2512 2499
2513 // TODO(mstarzinger): Both public because of ConvertAnsSetLocalProperty(). 2500 // TODO(mstarzinger): Both public because of ConvertAnsSetLocalProperty().
2514 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); 2501 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map);
2515 static void GeneralizeFieldRepresentation(Handle<JSObject> object, 2502 static void GeneralizeFieldRepresentation(Handle<JSObject> object,
2516 int modify_index, 2503 int modify_index,
2517 Representation new_representation, 2504 Representation new_representation,
2518 StoreMode store_mode); 2505 StoreMode store_mode);
2519 2506
2520 // Convert the object to use the canonical dictionary 2507 // Convert the object to use the canonical dictionary
2521 // representation. If the object is expected to have additional properties 2508 // representation. If the object is expected to have additional properties
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 Handle<Object> old_value); 2679 Handle<Object> old_value);
2693 2680
2694 // Deliver change records to observers. May cause GC. 2681 // Deliver change records to observers. May cause GC.
2695 static void DeliverChangeRecords(Isolate* isolate); 2682 static void DeliverChangeRecords(Isolate* isolate);
2696 2683
2697 private: 2684 private:
2698 friend class DictionaryElementsAccessor; 2685 friend class DictionaryElementsAccessor;
2699 friend class JSReceiver; 2686 friend class JSReceiver;
2700 friend class Object; 2687 friend class Object;
2701 2688
2689 static void UpdateAllocationSite(Handle<JSObject> object,
2690 ElementsKind to_kind);
2691 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind);
2692
2702 // Used from Object::GetProperty(). 2693 // Used from Object::GetProperty().
2703 static Handle<Object> GetPropertyWithFailedAccessCheck( 2694 static Handle<Object> GetPropertyWithFailedAccessCheck(
2704 Handle<JSObject> object, 2695 Handle<JSObject> object,
2705 Handle<Object> receiver, 2696 Handle<Object> receiver,
2706 LookupResult* result, 2697 LookupResult* result,
2707 Handle<Name> name, 2698 Handle<Name> name,
2708 PropertyAttributes* attributes); 2699 PropertyAttributes* attributes);
2709 2700
2710 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, 2701 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver,
2711 Object* structure, 2702 Object* structure,
2712 uint32_t index, 2703 uint32_t index,
2713 Object* holder); 2704 Object* holder);
2714 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( 2705 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor(
2715 JSReceiver* receiver, 2706 JSReceiver* receiver,
2716 uint32_t index, 2707 uint32_t index,
2717 bool continue_search); 2708 bool continue_search);
2718 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor( 2709 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor(
2719 JSReceiver* receiver, 2710 JSReceiver* receiver,
2720 uint32_t index, 2711 uint32_t index,
2721 bool continue_search); 2712 bool continue_search);
2722 static Handle<Object> SetElementWithCallback( 2713 static Handle<Object> SetElementWithCallback(
2723 Handle<JSObject> object, 2714 Handle<JSObject> object,
2724 Handle<Object> structure, 2715 Handle<Object> structure,
2725 uint32_t index, 2716 uint32_t index,
2726 Handle<Object> value, 2717 Handle<Object> value,
2727 Handle<JSObject> holder, 2718 Handle<JSObject> holder,
2728 StrictModeFlag strict_mode); 2719 StrictModeFlag strict_mode);
2729 MUST_USE_RESULT MaybeObject* SetElementWithInterceptor( 2720 static Handle<Object> SetElementWithInterceptor(
2721 Handle<JSObject> object,
2730 uint32_t index, 2722 uint32_t index,
2731 Object* value, 2723 Handle<Object> value,
2732 PropertyAttributes attributes, 2724 PropertyAttributes attributes,
2733 StrictModeFlag strict_mode, 2725 StrictModeFlag strict_mode,
2734 bool check_prototype, 2726 bool check_prototype,
2735 SetPropertyMode set_mode); 2727 SetPropertyMode set_mode);
2736 MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor( 2728 static Handle<Object> SetElementWithoutInterceptor(
2729 Handle<JSObject> object,
2737 uint32_t index, 2730 uint32_t index,
2738 Object* value, 2731 Handle<Object> value,
2739 PropertyAttributes attributes, 2732 PropertyAttributes attributes,
2740 StrictModeFlag strict_mode, 2733 StrictModeFlag strict_mode,
2741 bool check_prototype, 2734 bool check_prototype,
2742 SetPropertyMode set_mode); 2735 SetPropertyMode set_mode);
2743 MUST_USE_RESULT MaybeObject* SetElementWithCallbackSetterInPrototypes( 2736 static Handle<Object> SetElementWithCallbackSetterInPrototypes(
2737 Handle<JSObject> object,
2744 uint32_t index, 2738 uint32_t index,
2745 Object* value, 2739 Handle<Object> value,
2746 bool* found, 2740 bool* found,
2747 StrictModeFlag strict_mode); 2741 StrictModeFlag strict_mode);
2742 static Handle<Object> SetDictionaryElement(
2743 Handle<JSObject> object,
2744 uint32_t index,
2745 Handle<Object> value,
2746 PropertyAttributes attributes,
2747 StrictModeFlag strict_mode,
2748 bool check_prototype,
2749 SetPropertyMode set_mode = SET_PROPERTY);
2750 static Handle<Object> SetFastDoubleElement(
2751 Handle<JSObject> object,
2752 uint32_t index,
2753 Handle<Object> value,
2754 StrictModeFlag strict_mode,
2755 bool check_prototype = true);
2748 2756
2749 // Searches the prototype chain for property 'name'. If it is found and 2757 // Searches the prototype chain for property 'name'. If it is found and
2750 // has a setter, invoke it and set '*done' to true. If it is found and is 2758 // has a setter, invoke it and set '*done' to true. If it is found and is
2751 // read-only, reject and set '*done' to true. Otherwise, set '*done' to 2759 // read-only, reject and set '*done' to true. Otherwise, set '*done' to
2752 // false. Can throw and return an empty handle with '*done==true'. 2760 // false. Can throw and return an empty handle with '*done==true'.
2753 static Handle<Object> SetPropertyViaPrototypes( 2761 static Handle<Object> SetPropertyViaPrototypes(
2754 Handle<JSObject> object, 2762 Handle<JSObject> object,
2755 Handle<Name> name, 2763 Handle<Name> name,
2756 Handle<Object> value, 2764 Handle<Object> value,
2757 PropertyAttributes attributes, 2765 PropertyAttributes attributes,
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
3999 class SeededNumberDictionary 4007 class SeededNumberDictionary
4000 : public Dictionary<SeededNumberDictionaryShape, uint32_t> { 4008 : public Dictionary<SeededNumberDictionaryShape, uint32_t> {
4001 public: 4009 public:
4002 static SeededNumberDictionary* cast(Object* obj) { 4010 static SeededNumberDictionary* cast(Object* obj) {
4003 ASSERT(obj->IsDictionary()); 4011 ASSERT(obj->IsDictionary());
4004 return reinterpret_cast<SeededNumberDictionary*>(obj); 4012 return reinterpret_cast<SeededNumberDictionary*>(obj);
4005 } 4013 }
4006 4014
4007 // Type specific at put (default NONE attributes is used when adding). 4015 // Type specific at put (default NONE attributes is used when adding).
4008 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value); 4016 MUST_USE_RESULT MaybeObject* AtNumberPut(uint32_t key, Object* value);
4017 MUST_USE_RESULT static Handle<SeededNumberDictionary> AddNumberEntry(
4018 Handle<SeededNumberDictionary> dictionary,
4019 uint32_t key,
4020 Handle<Object> value,
4021 PropertyDetails details);
4009 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key, 4022 MUST_USE_RESULT MaybeObject* AddNumberEntry(uint32_t key,
4010 Object* value, 4023 Object* value,
4011 PropertyDetails details); 4024 PropertyDetails details);
4012 4025
4013 // Set an existing entry or add a new one if needed. 4026 // Set an existing entry or add a new one if needed.
4014 // Return the updated dictionary. 4027 // Return the updated dictionary.
4015 MUST_USE_RESULT static Handle<SeededNumberDictionary> Set( 4028 MUST_USE_RESULT static Handle<SeededNumberDictionary> Set(
4016 Handle<SeededNumberDictionary> dictionary, 4029 Handle<SeededNumberDictionary> dictionary,
4017 uint32_t index, 4030 uint32_t index,
4018 Handle<Object> value, 4031 Handle<Object> value,
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
4623 }; 4636 };
4624 4637
4625 4638
4626 class ExternalByteArray: public ExternalArray { 4639 class ExternalByteArray: public ExternalArray {
4627 public: 4640 public:
4628 // Setter and getter. 4641 // Setter and getter.
4629 inline int8_t get_scalar(int index); 4642 inline int8_t get_scalar(int index);
4630 MUST_USE_RESULT inline MaybeObject* get(int index); 4643 MUST_USE_RESULT inline MaybeObject* get(int index);
4631 inline void set(int index, int8_t value); 4644 inline void set(int index, int8_t value);
4632 4645
4646 static Handle<Object> SetValue(Handle<ExternalByteArray> array,
4647 uint32_t index,
4648 Handle<Object> value);
4649
4633 // This accessor applies the correct conversion from Smi, HeapNumber 4650 // This accessor applies the correct conversion from Smi, HeapNumber
4634 // and undefined. 4651 // and undefined.
4635 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4652 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4636 4653
4637 // Casting. 4654 // Casting.
4638 static inline ExternalByteArray* cast(Object* obj); 4655 static inline ExternalByteArray* cast(Object* obj);
4639 4656
4640 // Dispatched behavior. 4657 // Dispatched behavior.
4641 DECLARE_PRINTER(ExternalByteArray) 4658 DECLARE_PRINTER(ExternalByteArray)
4642 DECLARE_VERIFIER(ExternalByteArray) 4659 DECLARE_VERIFIER(ExternalByteArray)
4643 4660
4644 private: 4661 private:
4645 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray); 4662 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalByteArray);
4646 }; 4663 };
4647 4664
4648 4665
4649 class ExternalUnsignedByteArray: public ExternalArray { 4666 class ExternalUnsignedByteArray: public ExternalArray {
4650 public: 4667 public:
4651 // Setter and getter. 4668 // Setter and getter.
4652 inline uint8_t get_scalar(int index); 4669 inline uint8_t get_scalar(int index);
4653 MUST_USE_RESULT inline MaybeObject* get(int index); 4670 MUST_USE_RESULT inline MaybeObject* get(int index);
4654 inline void set(int index, uint8_t value); 4671 inline void set(int index, uint8_t value);
4655 4672
4673 static Handle<Object> SetValue(Handle<ExternalUnsignedByteArray> array,
4674 uint32_t index,
4675 Handle<Object> value);
4676
4656 // This accessor applies the correct conversion from Smi, HeapNumber 4677 // This accessor applies the correct conversion from Smi, HeapNumber
4657 // and undefined. 4678 // and undefined.
4658 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4679 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4659 4680
4660 // Casting. 4681 // Casting.
4661 static inline ExternalUnsignedByteArray* cast(Object* obj); 4682 static inline ExternalUnsignedByteArray* cast(Object* obj);
4662 4683
4663 // Dispatched behavior. 4684 // Dispatched behavior.
4664 DECLARE_PRINTER(ExternalUnsignedByteArray) 4685 DECLARE_PRINTER(ExternalUnsignedByteArray)
4665 DECLARE_VERIFIER(ExternalUnsignedByteArray) 4686 DECLARE_VERIFIER(ExternalUnsignedByteArray)
4666 4687
4667 private: 4688 private:
4668 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray); 4689 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedByteArray);
4669 }; 4690 };
4670 4691
4671 4692
4672 class ExternalShortArray: public ExternalArray { 4693 class ExternalShortArray: public ExternalArray {
4673 public: 4694 public:
4674 // Setter and getter. 4695 // Setter and getter.
4675 inline int16_t get_scalar(int index); 4696 inline int16_t get_scalar(int index);
4676 MUST_USE_RESULT inline MaybeObject* get(int index); 4697 MUST_USE_RESULT inline MaybeObject* get(int index);
4677 inline void set(int index, int16_t value); 4698 inline void set(int index, int16_t value);
4678 4699
4700 static Handle<Object> SetValue(Handle<ExternalShortArray> array,
4701 uint32_t index,
4702 Handle<Object> value);
4703
4679 // This accessor applies the correct conversion from Smi, HeapNumber 4704 // This accessor applies the correct conversion from Smi, HeapNumber
4680 // and undefined. 4705 // and undefined.
4681 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4706 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4682 4707
4683 // Casting. 4708 // Casting.
4684 static inline ExternalShortArray* cast(Object* obj); 4709 static inline ExternalShortArray* cast(Object* obj);
4685 4710
4686 // Dispatched behavior. 4711 // Dispatched behavior.
4687 DECLARE_PRINTER(ExternalShortArray) 4712 DECLARE_PRINTER(ExternalShortArray)
4688 DECLARE_VERIFIER(ExternalShortArray) 4713 DECLARE_VERIFIER(ExternalShortArray)
4689 4714
4690 private: 4715 private:
4691 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray); 4716 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalShortArray);
4692 }; 4717 };
4693 4718
4694 4719
4695 class ExternalUnsignedShortArray: public ExternalArray { 4720 class ExternalUnsignedShortArray: public ExternalArray {
4696 public: 4721 public:
4697 // Setter and getter. 4722 // Setter and getter.
4698 inline uint16_t get_scalar(int index); 4723 inline uint16_t get_scalar(int index);
4699 MUST_USE_RESULT inline MaybeObject* get(int index); 4724 MUST_USE_RESULT inline MaybeObject* get(int index);
4700 inline void set(int index, uint16_t value); 4725 inline void set(int index, uint16_t value);
4701 4726
4727 static Handle<Object> SetValue(Handle<ExternalUnsignedShortArray> array,
4728 uint32_t index,
4729 Handle<Object> value);
4730
4702 // This accessor applies the correct conversion from Smi, HeapNumber 4731 // This accessor applies the correct conversion from Smi, HeapNumber
4703 // and undefined. 4732 // and undefined.
4704 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4733 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4705 4734
4706 // Casting. 4735 // Casting.
4707 static inline ExternalUnsignedShortArray* cast(Object* obj); 4736 static inline ExternalUnsignedShortArray* cast(Object* obj);
4708 4737
4709 // Dispatched behavior. 4738 // Dispatched behavior.
4710 DECLARE_PRINTER(ExternalUnsignedShortArray) 4739 DECLARE_PRINTER(ExternalUnsignedShortArray)
4711 DECLARE_VERIFIER(ExternalUnsignedShortArray) 4740 DECLARE_VERIFIER(ExternalUnsignedShortArray)
4712 4741
4713 private: 4742 private:
4714 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray); 4743 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedShortArray);
4715 }; 4744 };
4716 4745
4717 4746
4718 class ExternalIntArray: public ExternalArray { 4747 class ExternalIntArray: public ExternalArray {
4719 public: 4748 public:
4720 // Setter and getter. 4749 // Setter and getter.
4721 inline int32_t get_scalar(int index); 4750 inline int32_t get_scalar(int index);
4722 MUST_USE_RESULT inline MaybeObject* get(int index); 4751 MUST_USE_RESULT inline MaybeObject* get(int index);
4723 inline void set(int index, int32_t value); 4752 inline void set(int index, int32_t value);
4724 4753
4754 static Handle<Object> SetValue(Handle<ExternalIntArray> array,
4755 uint32_t index,
4756 Handle<Object> value);
4757
4725 // This accessor applies the correct conversion from Smi, HeapNumber 4758 // This accessor applies the correct conversion from Smi, HeapNumber
4726 // and undefined. 4759 // and undefined.
4727 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4760 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4728 4761
4729 // Casting. 4762 // Casting.
4730 static inline ExternalIntArray* cast(Object* obj); 4763 static inline ExternalIntArray* cast(Object* obj);
4731 4764
4732 // Dispatched behavior. 4765 // Dispatched behavior.
4733 DECLARE_PRINTER(ExternalIntArray) 4766 DECLARE_PRINTER(ExternalIntArray)
4734 DECLARE_VERIFIER(ExternalIntArray) 4767 DECLARE_VERIFIER(ExternalIntArray)
4735 4768
4736 private: 4769 private:
4737 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray); 4770 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalIntArray);
4738 }; 4771 };
4739 4772
4740 4773
4741 class ExternalUnsignedIntArray: public ExternalArray { 4774 class ExternalUnsignedIntArray: public ExternalArray {
4742 public: 4775 public:
4743 // Setter and getter. 4776 // Setter and getter.
4744 inline uint32_t get_scalar(int index); 4777 inline uint32_t get_scalar(int index);
4745 MUST_USE_RESULT inline MaybeObject* get(int index); 4778 MUST_USE_RESULT inline MaybeObject* get(int index);
4746 inline void set(int index, uint32_t value); 4779 inline void set(int index, uint32_t value);
4747 4780
4781 static Handle<Object> SetValue(Handle<ExternalUnsignedIntArray> array,
4782 uint32_t index,
4783 Handle<Object> value);
4784
4748 // This accessor applies the correct conversion from Smi, HeapNumber 4785 // This accessor applies the correct conversion from Smi, HeapNumber
4749 // and undefined. 4786 // and undefined.
4750 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4787 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4751 4788
4752 // Casting. 4789 // Casting.
4753 static inline ExternalUnsignedIntArray* cast(Object* obj); 4790 static inline ExternalUnsignedIntArray* cast(Object* obj);
4754 4791
4755 // Dispatched behavior. 4792 // Dispatched behavior.
4756 DECLARE_PRINTER(ExternalUnsignedIntArray) 4793 DECLARE_PRINTER(ExternalUnsignedIntArray)
4757 DECLARE_VERIFIER(ExternalUnsignedIntArray) 4794 DECLARE_VERIFIER(ExternalUnsignedIntArray)
4758 4795
4759 private: 4796 private:
4760 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray); 4797 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUnsignedIntArray);
4761 }; 4798 };
4762 4799
4763 4800
4764 class ExternalFloatArray: public ExternalArray { 4801 class ExternalFloatArray: public ExternalArray {
4765 public: 4802 public:
4766 // Setter and getter. 4803 // Setter and getter.
4767 inline float get_scalar(int index); 4804 inline float get_scalar(int index);
4768 MUST_USE_RESULT inline MaybeObject* get(int index); 4805 MUST_USE_RESULT inline MaybeObject* get(int index);
4769 inline void set(int index, float value); 4806 inline void set(int index, float value);
4770 4807
4808 static Handle<Object> SetValue(Handle<ExternalFloatArray> array,
4809 uint32_t index,
4810 Handle<Object> value);
4811
4771 // This accessor applies the correct conversion from Smi, HeapNumber 4812 // This accessor applies the correct conversion from Smi, HeapNumber
4772 // and undefined. 4813 // and undefined.
4773 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4814 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4774 4815
4775 // Casting. 4816 // Casting.
4776 static inline ExternalFloatArray* cast(Object* obj); 4817 static inline ExternalFloatArray* cast(Object* obj);
4777 4818
4778 // Dispatched behavior. 4819 // Dispatched behavior.
4779 DECLARE_PRINTER(ExternalFloatArray) 4820 DECLARE_PRINTER(ExternalFloatArray)
4780 DECLARE_VERIFIER(ExternalFloatArray) 4821 DECLARE_VERIFIER(ExternalFloatArray)
4781 4822
4782 private: 4823 private:
4783 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray); 4824 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloatArray);
4784 }; 4825 };
4785 4826
4786 4827
4787 class ExternalDoubleArray: public ExternalArray { 4828 class ExternalDoubleArray: public ExternalArray {
4788 public: 4829 public:
4789 // Setter and getter. 4830 // Setter and getter.
4790 inline double get_scalar(int index); 4831 inline double get_scalar(int index);
4791 MUST_USE_RESULT inline MaybeObject* get(int index); 4832 MUST_USE_RESULT inline MaybeObject* get(int index);
4792 inline void set(int index, double value); 4833 inline void set(int index, double value);
4793 4834
4835 static Handle<Object> SetValue(Handle<ExternalDoubleArray> array,
4836 uint32_t index,
4837 Handle<Object> value);
4838
4794 // This accessor applies the correct conversion from Smi, HeapNumber 4839 // This accessor applies the correct conversion from Smi, HeapNumber
4795 // and undefined. 4840 // and undefined.
4796 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value); 4841 MUST_USE_RESULT MaybeObject* SetValue(uint32_t index, Object* value);
4797 4842
4798 // Casting. 4843 // Casting.
4799 static inline ExternalDoubleArray* cast(Object* obj); 4844 static inline ExternalDoubleArray* cast(Object* obj);
4800 4845
4801 // Dispatched behavior. 4846 // Dispatched behavior.
4802 DECLARE_PRINTER(ExternalDoubleArray) 4847 DECLARE_PRINTER(ExternalDoubleArray)
4803 DECLARE_VERIFIER(ExternalDoubleArray) 4848 DECLARE_VERIFIER(ExternalDoubleArray)
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
5286 Kind kind, 5331 Kind kind,
5287 InlineCacheState ic_state = UNINITIALIZED, 5332 InlineCacheState ic_state = UNINITIALIZED,
5288 ExtraICState extra_ic_state = kNoExtraICState, 5333 ExtraICState extra_ic_state = kNoExtraICState,
5289 StubType type = NORMAL, 5334 StubType type = NORMAL,
5290 int argc = -1, 5335 int argc = -1,
5291 InlineCacheHolderFlag holder = OWN_MAP); 5336 InlineCacheHolderFlag holder = OWN_MAP);
5292 5337
5293 static inline Flags ComputeMonomorphicFlags( 5338 static inline Flags ComputeMonomorphicFlags(
5294 Kind kind, 5339 Kind kind,
5295 ExtraICState extra_ic_state = kNoExtraICState, 5340 ExtraICState extra_ic_state = kNoExtraICState,
5341 InlineCacheHolderFlag holder = OWN_MAP,
5296 StubType type = NORMAL, 5342 StubType type = NORMAL,
5297 int argc = -1, 5343 int argc = -1);
5298 InlineCacheHolderFlag holder = OWN_MAP);
5299 5344
5300 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); 5345 static inline InlineCacheState ExtractICStateFromFlags(Flags flags);
5301 static inline StubType ExtractTypeFromFlags(Flags flags); 5346 static inline StubType ExtractTypeFromFlags(Flags flags);
5302 static inline Kind ExtractKindFromFlags(Flags flags); 5347 static inline Kind ExtractKindFromFlags(Flags flags);
5303 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); 5348 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags);
5304 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); 5349 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags);
5305 static inline ExtraICState ExtractExtendedExtraICStateFromFlags(Flags flags); 5350 static inline ExtraICState ExtractExtendedExtraICStateFromFlags(Flags flags);
5306 static inline int ExtractArgumentsCountFromFlags(Flags flags); 5351 static inline int ExtractArgumentsCountFromFlags(Flags flags);
5307 5352
5308 static inline Flags RemoveTypeFromFlags(Flags flags); 5353 static inline Flags RemoveTypeFromFlags(Flags flags);
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
5598 // described by this map. The group is deoptimized whenever an object 5643 // described by this map. The group is deoptimized whenever an object
5599 // described by this map changes shape (and transitions to a new map), 5644 // described by this map changes shape (and transitions to a new map),
5600 // possibly invalidating the assumptions embedded in the code. 5645 // possibly invalidating the assumptions embedded in the code.
5601 kPrototypeCheckGroup, 5646 kPrototypeCheckGroup,
5602 // Group of code that depends on elements not being added to objects with 5647 // Group of code that depends on elements not being added to objects with
5603 // this map. 5648 // this map.
5604 kElementsCantBeAddedGroup, 5649 kElementsCantBeAddedGroup,
5605 // Group of code that depends on global property values in property cells 5650 // Group of code that depends on global property values in property cells
5606 // not being changed. 5651 // not being changed.
5607 kPropertyCellChangedGroup, 5652 kPropertyCellChangedGroup,
5608 kGroupCount = kPropertyCellChangedGroup + 1 5653 // Group of code that depends on tenuring information in AllocationSites
5654 // not being changed.
5655 kAllocationSiteTenuringChangedGroup,
5656 // Group of code that depends on element transition information in
5657 // AllocationSites not being changed.
5658 kAllocationSiteTransitionChangedGroup,
5659 kGroupCount = kAllocationSiteTransitionChangedGroup + 1
5609 }; 5660 };
5610 5661
5611 // Array for holding the index of the first code object of each group. 5662 // Array for holding the index of the first code object of each group.
5612 // The last element stores the total number of code objects. 5663 // The last element stores the total number of code objects.
5613 class GroupStartIndexes { 5664 class GroupStartIndexes {
5614 public: 5665 public:
5615 explicit GroupStartIndexes(DependentCode* entries); 5666 explicit GroupStartIndexes(DependentCode* entries);
5616 void Recompute(DependentCode* entries); 5667 void Recompute(DependentCode* entries);
5617 int at(int i) { return start_indexes_[i]; } 5668 int at(int i) { return start_indexes_[i]; }
5618 int number_of_entries() { return start_indexes_[kGroupCount]; } 5669 int number_of_entries() { return start_indexes_[kGroupCount]; }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
5698 // Bit field 3. 5749 // Bit field 3.
5699 inline uint32_t bit_field3(); 5750 inline uint32_t bit_field3();
5700 inline void set_bit_field3(uint32_t bits); 5751 inline void set_bit_field3(uint32_t bits);
5701 5752
5702 class EnumLengthBits: public BitField<int, 0, 11> {}; 5753 class EnumLengthBits: public BitField<int, 0, 11> {};
5703 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; 5754 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {};
5704 class IsShared: public BitField<bool, 22, 1> {}; 5755 class IsShared: public BitField<bool, 22, 1> {};
5705 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; 5756 class FunctionWithPrototype: public BitField<bool, 23, 1> {};
5706 class DictionaryMap: public BitField<bool, 24, 1> {}; 5757 class DictionaryMap: public BitField<bool, 24, 1> {};
5707 class OwnsDescriptors: public BitField<bool, 25, 1> {}; 5758 class OwnsDescriptors: public BitField<bool, 25, 1> {};
5708 class IsObserved: public BitField<bool, 26, 1> {}; 5759 class HasInstanceCallHandler: public BitField<bool, 26, 1> {};
5709 class Deprecated: public BitField<bool, 27, 1> {}; 5760 class Deprecated: public BitField<bool, 27, 1> {};
5710 class IsFrozen: public BitField<bool, 28, 1> {}; 5761 class IsFrozen: public BitField<bool, 28, 1> {};
5711 class IsUnstable: public BitField<bool, 29, 1> {}; 5762 class IsUnstable: public BitField<bool, 29, 1> {};
5712 class IsMigrationTarget: public BitField<bool, 30, 1> {}; 5763 class IsMigrationTarget: public BitField<bool, 30, 1> {};
5713 5764
5714 // Tells whether the object in the prototype property will be used 5765 // Tells whether the object in the prototype property will be used
5715 // for instances created from this function. If the prototype 5766 // for instances created from this function. If the prototype
5716 // property is set to a value that is not a JSObject, the prototype 5767 // property is set to a value that is not a JSObject, the prototype
5717 // property will not be used to create instances of the function. 5768 // property will not be used to create instances of the function.
5718 // See ECMA-262, 13.2.2. 5769 // See ECMA-262, 13.2.2.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5761 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. 5812 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549.
5762 inline void set_is_undetectable() { 5813 inline void set_is_undetectable() {
5763 set_bit_field(bit_field() | (1 << kIsUndetectable)); 5814 set_bit_field(bit_field() | (1 << kIsUndetectable));
5764 } 5815 }
5765 5816
5766 inline bool is_undetectable() { 5817 inline bool is_undetectable() {
5767 return ((1 << kIsUndetectable) & bit_field()) != 0; 5818 return ((1 << kIsUndetectable) & bit_field()) != 0;
5768 } 5819 }
5769 5820
5770 // Tells whether the instance has a call-as-function handler. 5821 // Tells whether the instance has a call-as-function handler.
5771 inline void set_has_instance_call_handler() { 5822 inline void set_is_observed() {
5772 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); 5823 set_bit_field(bit_field() | (1 << kIsObserved));
5773 } 5824 }
5774 5825
5775 inline bool has_instance_call_handler() { 5826 inline bool is_observed() {
5776 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; 5827 return ((1 << kIsObserved) & bit_field()) != 0;
5777 } 5828 }
5778 5829
5779 inline void set_is_extensible(bool value); 5830 inline void set_is_extensible(bool value);
5780 inline bool is_extensible(); 5831 inline bool is_extensible();
5781 5832
5782 inline void set_elements_kind(ElementsKind elements_kind) { 5833 inline void set_elements_kind(ElementsKind elements_kind) {
5783 ASSERT(elements_kind < kElementsKindCount); 5834 ASSERT(elements_kind < kElementsKindCount);
5784 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount)); 5835 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount));
5785 ASSERT(!is_observed() ||
5786 elements_kind == DICTIONARY_ELEMENTS ||
5787 elements_kind == NON_STRICT_ARGUMENTS_ELEMENTS ||
5788 IsExternalArrayElementsKind(elements_kind));
5789 set_bit_field2((bit_field2() & ~kElementsKindMask) | 5836 set_bit_field2((bit_field2() & ~kElementsKindMask) |
5790 (elements_kind << kElementsKindShift)); 5837 (elements_kind << kElementsKindShift));
5791 ASSERT(this->elements_kind() == elements_kind); 5838 ASSERT(this->elements_kind() == elements_kind);
5792 } 5839 }
5793 5840
5794 inline ElementsKind elements_kind() { 5841 inline ElementsKind elements_kind() {
5795 return static_cast<ElementsKind>( 5842 return static_cast<ElementsKind>(
5796 (bit_field2() & kElementsKindMask) >> kElementsKindShift); 5843 (bit_field2() & kElementsKindMask) >> kElementsKindShift);
5797 } 5844 }
5798 5845
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
6031 if (length != kInvalidEnumCache) { 6078 if (length != kInvalidEnumCache) {
6032 ASSERT(length >= 0); 6079 ASSERT(length >= 0);
6033 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); 6080 ASSERT(length == 0 || instance_descriptors()->HasEnumCache());
6034 ASSERT(length <= NumberOfOwnDescriptors()); 6081 ASSERT(length <= NumberOfOwnDescriptors());
6035 } 6082 }
6036 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); 6083 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
6037 } 6084 }
6038 6085
6039 inline bool owns_descriptors(); 6086 inline bool owns_descriptors();
6040 inline void set_owns_descriptors(bool is_shared); 6087 inline void set_owns_descriptors(bool is_shared);
6041 inline bool is_observed(); 6088 inline bool has_instance_call_handler();
6042 inline void set_is_observed(bool is_observed); 6089 inline void set_has_instance_call_handler();
6043 inline void freeze(); 6090 inline void freeze();
6044 inline bool is_frozen(); 6091 inline bool is_frozen();
6045 inline void mark_unstable(); 6092 inline void mark_unstable();
6046 inline bool is_stable(); 6093 inline bool is_stable();
6047 inline void set_migration_target(bool value); 6094 inline void set_migration_target(bool value);
6048 inline bool is_migration_target(); 6095 inline bool is_migration_target();
6049 inline void deprecate(); 6096 inline void deprecate();
6050 inline bool is_deprecated(); 6097 inline bool is_deprecated();
6051 inline bool CanBeDeprecated(); 6098 inline bool CanBeDeprecated();
6052 // Returns a non-deprecated version of the input. If the input was not 6099 // Returns a non-deprecated version of the input. If the input was not
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
6291 6338
6292 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); 6339 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset);
6293 6340
6294 // Bit positions for bit field. 6341 // Bit positions for bit field.
6295 static const int kUnused = 0; // To be used for marking recently used maps. 6342 static const int kUnused = 0; // To be used for marking recently used maps.
6296 static const int kHasNonInstancePrototype = 1; 6343 static const int kHasNonInstancePrototype = 1;
6297 static const int kIsHiddenPrototype = 2; 6344 static const int kIsHiddenPrototype = 2;
6298 static const int kHasNamedInterceptor = 3; 6345 static const int kHasNamedInterceptor = 3;
6299 static const int kHasIndexedInterceptor = 4; 6346 static const int kHasIndexedInterceptor = 4;
6300 static const int kIsUndetectable = 5; 6347 static const int kIsUndetectable = 5;
6301 static const int kHasInstanceCallHandler = 6; 6348 static const int kIsObserved = 6;
6302 static const int kIsAccessCheckNeeded = 7; 6349 static const int kIsAccessCheckNeeded = 7;
6303 6350
6304 // Bit positions for bit field 2 6351 // Bit positions for bit field 2
6305 static const int kIsExtensible = 0; 6352 static const int kIsExtensible = 0;
6306 static const int kStringWrapperSafeForDefaultValueOf = 1; 6353 static const int kStringWrapperSafeForDefaultValueOf = 1;
6307 static const int kAttachedToSharedFunctionInfo = 2; 6354 static const int kAttachedToSharedFunctionInfo = 2;
6308 // No bits can be used after kElementsKindFirstBit, they are all reserved for 6355 // No bits can be used after kElementsKindFirstBit, they are all reserved for
6309 // storing ElementKind. 6356 // storing ElementKind.
6310 static const int kElementsKindShift = 3; 6357 static const int kElementsKindShift = 3;
6311 static const int kElementsKindBitCount = 5; 6358 static const int kElementsKindBitCount = 5;
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
6815 6862
6816 // True if the function has any duplicated parameter names. 6863 // True if the function has any duplicated parameter names.
6817 DECL_BOOLEAN_ACCESSORS(has_duplicate_parameters) 6864 DECL_BOOLEAN_ACCESSORS(has_duplicate_parameters)
6818 6865
6819 // Indicates whether the function is a native function. 6866 // Indicates whether the function is a native function.
6820 // These needs special treatment in .call and .apply since 6867 // These needs special treatment in .call and .apply since
6821 // null passed as the receiver should not be translated to the 6868 // null passed as the receiver should not be translated to the
6822 // global object. 6869 // global object.
6823 DECL_BOOLEAN_ACCESSORS(native) 6870 DECL_BOOLEAN_ACCESSORS(native)
6824 6871
6872 // Indicate that this builtin needs to be inlined in crankshaft.
6873 DECL_BOOLEAN_ACCESSORS(inline_builtin)
6874
6825 // Indicates that the function was created by the Function function. 6875 // Indicates that the function was created by the Function function.
6826 // Though it's anonymous, toString should treat it as if it had the name 6876 // Though it's anonymous, toString should treat it as if it had the name
6827 // "anonymous". We don't set the name itself so that the system does not 6877 // "anonymous". We don't set the name itself so that the system does not
6828 // see a binding for it. 6878 // see a binding for it.
6829 DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous) 6879 DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous)
6830 6880
6831 // Indicates whether the function is a bound function created using 6881 // Indicates whether the function is a bound function created using
6832 // the bind function. 6882 // the bind function.
6833 DECL_BOOLEAN_ACCESSORS(bound) 6883 DECL_BOOLEAN_ACCESSORS(bound)
6834 6884
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
6904 set_opt_count_and_bailout_reason( 6954 set_opt_count_and_bailout_reason(
6905 DisabledOptimizationReasonBits::update(opt_count_and_bailout_reason(), 6955 DisabledOptimizationReasonBits::update(opt_count_and_bailout_reason(),
6906 reason)); 6956 reason));
6907 } 6957 }
6908 6958
6909 void set_dont_optimize_reason(BailoutReason reason) { 6959 void set_dont_optimize_reason(BailoutReason reason) {
6910 set_bailout_reason(reason); 6960 set_bailout_reason(reason);
6911 set_dont_optimize(reason != kNoReason); 6961 set_dont_optimize(reason != kNoReason);
6912 } 6962 }
6913 6963
6964 // Check whether or not this function is inlineable.
6965 bool IsInlineable();
6966
6914 // Source size of this function. 6967 // Source size of this function.
6915 int SourceSize(); 6968 int SourceSize();
6916 6969
6917 // Calculate the instance size. 6970 // Calculate the instance size.
6918 int CalculateInstanceSize(); 6971 int CalculateInstanceSize();
6919 6972
6920 // Calculate the number of in-object properties. 6973 // Calculate the number of in-object properties.
6921 int CalculateInObjectProperties(); 6974 int CalculateInObjectProperties();
6922 6975
6923 // Dispatched behavior. 6976 // Dispatched behavior.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
7054 enum CompilerHints { 7107 enum CompilerHints {
7055 kAllowLazyCompilation, 7108 kAllowLazyCompilation,
7056 kAllowLazyCompilationWithoutContext, 7109 kAllowLazyCompilationWithoutContext,
7057 kLiveObjectsMayExist, 7110 kLiveObjectsMayExist,
7058 kOptimizationDisabled, 7111 kOptimizationDisabled,
7059 kStrictModeFunction, 7112 kStrictModeFunction,
7060 kExtendedModeFunction, 7113 kExtendedModeFunction,
7061 kUsesArguments, 7114 kUsesArguments,
7062 kHasDuplicateParameters, 7115 kHasDuplicateParameters,
7063 kNative, 7116 kNative,
7117 kInlineBuiltin,
7064 kBoundFunction, 7118 kBoundFunction,
7065 kIsAnonymous, 7119 kIsAnonymous,
7066 kNameShouldPrintAsAnonymous, 7120 kNameShouldPrintAsAnonymous,
7067 kIsFunction, 7121 kIsFunction,
7068 kDontOptimize, 7122 kDontOptimize,
7069 kDontInline, 7123 kDontInline,
7070 kDontCache, 7124 kDontCache,
7071 kDontFlush, 7125 kDontFlush,
7072 kIsGenerator, 7126 kIsGenerator,
7073 kCompilerHintsCount // Pseudo entry 7127 kCompilerHintsCount // Pseudo entry
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
7280 ClearExceptionFlag flag); 7334 ClearExceptionFlag flag);
7281 7335
7282 // Tells whether or not the function is already marked for lazy 7336 // Tells whether or not the function is already marked for lazy
7283 // recompilation. 7337 // recompilation.
7284 inline bool IsMarkedForLazyRecompilation(); 7338 inline bool IsMarkedForLazyRecompilation();
7285 inline bool IsMarkedForConcurrentRecompilation(); 7339 inline bool IsMarkedForConcurrentRecompilation();
7286 7340
7287 // Tells whether or not the function is on the concurrent recompilation queue. 7341 // Tells whether or not the function is on the concurrent recompilation queue.
7288 inline bool IsInRecompileQueue(); 7342 inline bool IsInRecompileQueue();
7289 7343
7290 // Check whether or not this function is inlineable.
7291 bool IsInlineable();
7292
7293 // [literals_or_bindings]: Fixed array holding either 7344 // [literals_or_bindings]: Fixed array holding either
7294 // the materialized literals or the bindings of a bound function. 7345 // the materialized literals or the bindings of a bound function.
7295 // 7346 //
7296 // If the function contains object, regexp or array literals, the 7347 // If the function contains object, regexp or array literals, the
7297 // literals array prefix contains the object, regexp, and array 7348 // literals array prefix contains the object, regexp, and array
7298 // function to be used when creating these literals. This is 7349 // function to be used when creating these literals. This is
7299 // necessary so that we do not dynamically lookup the object, regexp 7350 // necessary so that we do not dynamically lookup the object, regexp
7300 // or array functions. Performing a dynamic lookup, we might end up 7351 // or array functions. Performing a dynamic lookup, we might end up
7301 // using the functions from a new context that we should not have 7352 // using the functions from a new context that we should not have
7302 // access to. 7353 // access to.
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
8116 8167
8117 inline void Initialize(); 8168 inline void Initialize();
8118 8169
8119 bool HasNestedSites() { 8170 bool HasNestedSites() {
8120 return nested_site()->IsAllocationSite(); 8171 return nested_site()->IsAllocationSite();
8121 } 8172 }
8122 8173
8123 // This method is expensive, it should only be called for reporting. 8174 // This method is expensive, it should only be called for reporting.
8124 bool IsNestedSite(); 8175 bool IsNestedSite();
8125 8176
8177 class ElementsKindBits: public BitField<ElementsKind, 0, 15> {};
8178 class UnusedBits: public BitField<int, 15, 14> {};
8179 class DoNotInlineBit: public BitField<bool, 29, 1> {};
8180
8126 ElementsKind GetElementsKind() { 8181 ElementsKind GetElementsKind() {
8127 ASSERT(!SitePointsToLiteral()); 8182 ASSERT(!SitePointsToLiteral());
8128 return static_cast<ElementsKind>(Smi::cast(transition_info())->value()); 8183 int value = Smi::cast(transition_info())->value();
8184 return ElementsKindBits::decode(value);
8129 } 8185 }
8130 8186
8131 void SetElementsKind(ElementsKind kind) { 8187 void SetElementsKind(ElementsKind kind) {
8132 set_transition_info(Smi::FromInt(static_cast<int>(kind))); 8188 int value = Smi::cast(transition_info())->value();
8189 set_transition_info(Smi::FromInt(ElementsKindBits::update(value, kind)),
8190 SKIP_WRITE_BARRIER);
8191 }
8192
8193 bool CanInlineCall() {
8194 int value = Smi::cast(transition_info())->value();
8195 return DoNotInlineBit::decode(value) == 0;
8196 }
8197
8198 void SetDoNotInlineCall() {
8199 int value = Smi::cast(transition_info())->value();
8200 set_transition_info(Smi::FromInt(DoNotInlineBit::update(value, true)),
8201 SKIP_WRITE_BARRIER);
8133 } 8202 }
8134 8203
8135 bool SitePointsToLiteral() { 8204 bool SitePointsToLiteral() {
8136 // If transition_info is a smi, then it represents an ElementsKind 8205 // If transition_info is a smi, then it represents an ElementsKind
8137 // for a constructed array. Otherwise, it must be a boilerplate 8206 // for a constructed array. Otherwise, it must be a boilerplate
8138 // for an object or array literal. 8207 // for an object or array literal.
8139 return transition_info()->IsJSArray() || transition_info()->IsJSObject(); 8208 return transition_info()->IsJSArray() || transition_info()->IsJSObject();
8140 } 8209 }
8141 8210
8211 MaybeObject* DigestTransitionFeedback(ElementsKind to_kind);
8212
8213 enum Reason {
8214 TENURING,
8215 TRANSITIONS
8216 };
8217
8218 void AddDependentCompilationInfo(Reason reason, CompilationInfo* info);
8219 void AddDependentCode(Reason reason, Handle<Code> code);
8220
8142 DECLARE_PRINTER(AllocationSite) 8221 DECLARE_PRINTER(AllocationSite)
8143 DECLARE_VERIFIER(AllocationSite) 8222 DECLARE_VERIFIER(AllocationSite)
8144 8223
8145 static inline AllocationSite* cast(Object* obj); 8224 static inline AllocationSite* cast(Object* obj);
8146 static inline AllocationSiteMode GetMode( 8225 static inline AllocationSiteMode GetMode(
8147 ElementsKind boilerplate_elements_kind); 8226 ElementsKind boilerplate_elements_kind);
8148 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); 8227 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
8149 static inline bool CanTrack(InstanceType type); 8228 static inline bool CanTrack(InstanceType type);
8150 8229
8151 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; 8230 static const int kTransitionInfoOffset = HeapObject::kHeaderSize;
8152 static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize; 8231 static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize;
8153 static const int kDependentCodeOffset = kNestedSiteOffset + kPointerSize; 8232 static const int kDependentCodeOffset = kNestedSiteOffset + kPointerSize;
8154 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; 8233 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize;
8155 static const int kSize = kWeakNextOffset + kPointerSize; 8234 static const int kSize = kWeakNextOffset + kPointerSize;
8156 8235
8157 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, 8236 typedef FixedBodyDescriptor<HeapObject::kHeaderSize,
8158 kDependentCodeOffset + kPointerSize, 8237 kDependentCodeOffset + kPointerSize,
8159 kSize> BodyDescriptor; 8238 kSize> BodyDescriptor;
8160 8239
8161 private: 8240 private:
8241 inline DependentCode::DependencyGroup ToDependencyGroup(Reason reason);
8162 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); 8242 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite);
8163 }; 8243 };
8164 8244
8165 8245
8166 class AllocationMemento: public Struct { 8246 class AllocationMemento: public Struct {
8167 public: 8247 public:
8168 static const int kAllocationSiteOffset = HeapObject::kHeaderSize; 8248 static const int kAllocationSiteOffset = HeapObject::kHeaderSize;
8169 static const int kSize = kAllocationSiteOffset + kPointerSize; 8249 static const int kSize = kAllocationSiteOffset + kPointerSize;
8170 8250
8171 DECL_ACCESSORS(allocation_site, Object) 8251 DECL_ACCESSORS(allocation_site, Object)
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
8410 DISALLOW_IMPLICIT_CONSTRUCTORS(Name); 8490 DISALLOW_IMPLICIT_CONSTRUCTORS(Name);
8411 }; 8491 };
8412 8492
8413 8493
8414 // ES6 symbols. 8494 // ES6 symbols.
8415 class Symbol: public Name { 8495 class Symbol: public Name {
8416 public: 8496 public:
8417 // [name]: the print name of a symbol, or undefined if none. 8497 // [name]: the print name of a symbol, or undefined if none.
8418 DECL_ACCESSORS(name, Object) 8498 DECL_ACCESSORS(name, Object)
8419 8499
8500 DECL_ACCESSORS(flags, Smi)
8501
8502 // [is_private]: whether this is a private symbol.
8503 DECL_BOOLEAN_ACCESSORS(is_private)
8504
8420 // Casting. 8505 // Casting.
8421 static inline Symbol* cast(Object* obj); 8506 static inline Symbol* cast(Object* obj);
8422 8507
8423 // Dispatched behavior. 8508 // Dispatched behavior.
8424 DECLARE_PRINTER(Symbol) 8509 DECLARE_PRINTER(Symbol)
8425 DECLARE_VERIFIER(Symbol) 8510 DECLARE_VERIFIER(Symbol)
8426 8511
8427 // Layout description. 8512 // Layout description.
8428 static const int kNameOffset = Name::kSize; 8513 static const int kNameOffset = Name::kSize;
8429 static const int kSize = kNameOffset + kPointerSize; 8514 static const int kFlagsOffset = kNameOffset + kPointerSize;
8515 static const int kSize = kFlagsOffset + kPointerSize;
8430 8516
8431 typedef FixedBodyDescriptor<kNameOffset, kNameOffset + kPointerSize, kSize> 8517 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor;
8432 BodyDescriptor;
8433 8518
8434 private: 8519 private:
8520 static const int kPrivateBit = 0;
8521
8435 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); 8522 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol);
8436 }; 8523 };
8437 8524
8438 8525
8439 class ConsString; 8526 class ConsString;
8440 8527
8441 // The String abstract class captures JavaScript string values: 8528 // The String abstract class captures JavaScript string values:
8442 // 8529 //
8443 // Ecma-262: 8530 // Ecma-262:
8444 // 4.3.16 String Value 8531 // 4.3.16 String Value
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after
9738 // - slow, backing storage is a HashTable with numbers as keys. 9825 // - slow, backing storage is a HashTable with numbers as keys.
9739 class JSArray: public JSObject { 9826 class JSArray: public JSObject {
9740 public: 9827 public:
9741 // [length]: The length property. 9828 // [length]: The length property.
9742 DECL_ACCESSORS(length, Object) 9829 DECL_ACCESSORS(length, Object)
9743 9830
9744 // Overload the length setter to skip write barrier when the length 9831 // Overload the length setter to skip write barrier when the length
9745 // is set to a smi. This matches the set function on FixedArray. 9832 // is set to a smi. This matches the set function on FixedArray.
9746 inline void set_length(Smi* length); 9833 inline void set_length(Smi* length);
9747 9834
9835 static void JSArrayUpdateLengthFromIndex(Handle<JSArray> array,
9836 uint32_t index,
9837 Handle<Object> value);
9838
9748 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index, 9839 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index,
9749 Object* value); 9840 Object* value);
9750 9841
9751 // Initialize the array with the given capacity. The function may 9842 // Initialize the array with the given capacity. The function may
9752 // fail due to out-of-memory situations, but only if the requested 9843 // fail due to out-of-memory situations, but only if the requested
9753 // capacity is non-zero. 9844 // capacity is non-zero.
9754 MUST_USE_RESULT MaybeObject* Initialize(int capacity, int length = 0); 9845 MUST_USE_RESULT MaybeObject* Initialize(int capacity, int length = 0);
9755 9846
9756 // Initializes the array to a certain length. 9847 // Initializes the array to a certain length.
9757 inline bool AllowsSetElementsLength(); 9848 inline bool AllowsSetElementsLength();
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
10517 } else { 10608 } else {
10518 value &= ~(1 << bit_position); 10609 value &= ~(1 << bit_position);
10519 } 10610 }
10520 return value; 10611 return value;
10521 } 10612 }
10522 }; 10613 };
10523 10614
10524 } } // namespace v8::internal 10615 } } // namespace v8::internal
10525 10616
10526 #endif // V8_OBJECTS_H_ 10617 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698