OLD | NEW |
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 V(MAP_TYPE) \ | 357 V(MAP_TYPE) \ |
358 V(CODE_TYPE) \ | 358 V(CODE_TYPE) \ |
359 V(ODDBALL_TYPE) \ | 359 V(ODDBALL_TYPE) \ |
360 V(CELL_TYPE) \ | 360 V(CELL_TYPE) \ |
361 V(PROPERTY_CELL_TYPE) \ | 361 V(PROPERTY_CELL_TYPE) \ |
362 V(BOX_TYPE) \ | |
363 \ | 362 \ |
364 V(HEAP_NUMBER_TYPE) \ | 363 V(HEAP_NUMBER_TYPE) \ |
365 V(FOREIGN_TYPE) \ | 364 V(FOREIGN_TYPE) \ |
366 V(BYTE_ARRAY_TYPE) \ | 365 V(BYTE_ARRAY_TYPE) \ |
367 V(FREE_SPACE_TYPE) \ | 366 V(FREE_SPACE_TYPE) \ |
368 /* Note: the order of these external array */ \ | 367 /* Note: the order of these external array */ \ |
369 /* types is relied upon in */ \ | 368 /* types is relied upon in */ \ |
370 /* Object::IsExternalArray(). */ \ | 369 /* Object::IsExternalArray(). */ \ |
371 V(EXTERNAL_BYTE_ARRAY_TYPE) \ | 370 V(EXTERNAL_BYTE_ARRAY_TYPE) \ |
372 V(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE) \ | 371 V(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE) \ |
(...skipping 17 matching lines...) Expand all Loading... |
390 V(OBJECT_TEMPLATE_INFO_TYPE) \ | 389 V(OBJECT_TEMPLATE_INFO_TYPE) \ |
391 V(SIGNATURE_INFO_TYPE) \ | 390 V(SIGNATURE_INFO_TYPE) \ |
392 V(TYPE_SWITCH_INFO_TYPE) \ | 391 V(TYPE_SWITCH_INFO_TYPE) \ |
393 V(ALLOCATION_MEMENTO_TYPE) \ | 392 V(ALLOCATION_MEMENTO_TYPE) \ |
394 V(ALLOCATION_SITE_TYPE) \ | 393 V(ALLOCATION_SITE_TYPE) \ |
395 V(SCRIPT_TYPE) \ | 394 V(SCRIPT_TYPE) \ |
396 V(CODE_CACHE_TYPE) \ | 395 V(CODE_CACHE_TYPE) \ |
397 V(POLYMORPHIC_CODE_CACHE_TYPE) \ | 396 V(POLYMORPHIC_CODE_CACHE_TYPE) \ |
398 V(TYPE_FEEDBACK_INFO_TYPE) \ | 397 V(TYPE_FEEDBACK_INFO_TYPE) \ |
399 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ | 398 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
| 399 V(BOX_TYPE) \ |
400 \ | 400 \ |
401 V(FIXED_ARRAY_TYPE) \ | 401 V(FIXED_ARRAY_TYPE) \ |
402 V(FIXED_DOUBLE_ARRAY_TYPE) \ | 402 V(FIXED_DOUBLE_ARRAY_TYPE) \ |
403 V(SHARED_FUNCTION_INFO_TYPE) \ | 403 V(SHARED_FUNCTION_INFO_TYPE) \ |
404 \ | 404 \ |
405 V(JS_MESSAGE_OBJECT_TYPE) \ | 405 V(JS_MESSAGE_OBJECT_TYPE) \ |
406 \ | 406 \ |
407 V(JS_VALUE_TYPE) \ | 407 V(JS_VALUE_TYPE) \ |
408 V(JS_DATE_TYPE) \ | 408 V(JS_DATE_TYPE) \ |
409 V(JS_OBJECT_TYPE) \ | 409 V(JS_OBJECT_TYPE) \ |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 694 |
695 // Non-string names | 695 // Non-string names |
696 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE | 696 SYMBOL_TYPE = kNotStringTag, // LAST_NAME_TYPE, FIRST_NONSTRING_TYPE |
697 | 697 |
698 // Objects allocated in their own spaces (never in new space). | 698 // Objects allocated in their own spaces (never in new space). |
699 MAP_TYPE, | 699 MAP_TYPE, |
700 CODE_TYPE, | 700 CODE_TYPE, |
701 ODDBALL_TYPE, | 701 ODDBALL_TYPE, |
702 CELL_TYPE, | 702 CELL_TYPE, |
703 PROPERTY_CELL_TYPE, | 703 PROPERTY_CELL_TYPE, |
704 BOX_TYPE, | |
705 | 704 |
706 // "Data", objects that cannot contain non-map-word pointers to heap | 705 // "Data", objects that cannot contain non-map-word pointers to heap |
707 // objects. | 706 // objects. |
708 HEAP_NUMBER_TYPE, | 707 HEAP_NUMBER_TYPE, |
709 FOREIGN_TYPE, | 708 FOREIGN_TYPE, |
710 BYTE_ARRAY_TYPE, | 709 BYTE_ARRAY_TYPE, |
711 FREE_SPACE_TYPE, | 710 FREE_SPACE_TYPE, |
712 EXTERNAL_BYTE_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE | 711 EXTERNAL_BYTE_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE |
713 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE, | 712 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE, |
714 EXTERNAL_SHORT_ARRAY_TYPE, | 713 EXTERNAL_SHORT_ARRAY_TYPE, |
(...skipping 18 matching lines...) Expand all Loading... |
733 OBJECT_TEMPLATE_INFO_TYPE, | 732 OBJECT_TEMPLATE_INFO_TYPE, |
734 SIGNATURE_INFO_TYPE, | 733 SIGNATURE_INFO_TYPE, |
735 TYPE_SWITCH_INFO_TYPE, | 734 TYPE_SWITCH_INFO_TYPE, |
736 ALLOCATION_SITE_TYPE, | 735 ALLOCATION_SITE_TYPE, |
737 ALLOCATION_MEMENTO_TYPE, | 736 ALLOCATION_MEMENTO_TYPE, |
738 SCRIPT_TYPE, | 737 SCRIPT_TYPE, |
739 CODE_CACHE_TYPE, | 738 CODE_CACHE_TYPE, |
740 POLYMORPHIC_CODE_CACHE_TYPE, | 739 POLYMORPHIC_CODE_CACHE_TYPE, |
741 TYPE_FEEDBACK_INFO_TYPE, | 740 TYPE_FEEDBACK_INFO_TYPE, |
742 ALIASED_ARGUMENTS_ENTRY_TYPE, | 741 ALIASED_ARGUMENTS_ENTRY_TYPE, |
| 742 BOX_TYPE, |
743 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT | 743 // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT |
744 // is defined. However as include/v8.h contain some of the instance type | 744 // is defined. However as include/v8.h contain some of the instance type |
745 // constants always having them avoids them getting different numbers | 745 // constants always having them avoids them getting different numbers |
746 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. | 746 // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not. |
747 DEBUG_INFO_TYPE, | 747 DEBUG_INFO_TYPE, |
748 BREAK_POINT_INFO_TYPE, | 748 BREAK_POINT_INFO_TYPE, |
749 | 749 |
750 FIXED_ARRAY_TYPE, | 750 FIXED_ARRAY_TYPE, |
751 SHARED_FUNCTION_INFO_TYPE, | 751 SHARED_FUNCTION_INFO_TYPE, |
752 | 752 |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 FORCE_DELETION | 1639 FORCE_DELETION |
1640 }; | 1640 }; |
1641 | 1641 |
1642 // A non-keyed store is of the form a.x = foo or a["x"] = foo whereas | 1642 // A non-keyed store is of the form a.x = foo or a["x"] = foo whereas |
1643 // a keyed store is of the form a[expression] = foo. | 1643 // a keyed store is of the form a[expression] = foo. |
1644 enum StoreFromKeyed { | 1644 enum StoreFromKeyed { |
1645 MAY_BE_STORE_FROM_KEYED, | 1645 MAY_BE_STORE_FROM_KEYED, |
1646 CERTAINLY_NOT_STORE_FROM_KEYED | 1646 CERTAINLY_NOT_STORE_FROM_KEYED |
1647 }; | 1647 }; |
1648 | 1648 |
| 1649 // Indicates whether a value can be loaded as a constant. |
| 1650 enum StoreMode { |
| 1651 ALLOW_AS_CONSTANT, |
| 1652 FORCE_FIELD |
| 1653 }; |
| 1654 |
1649 // Internal properties (e.g. the hidden properties dictionary) might | 1655 // Internal properties (e.g. the hidden properties dictionary) might |
1650 // be added even though the receiver is non-extensible. | 1656 // be added even though the receiver is non-extensible. |
1651 enum ExtensibilityCheck { | 1657 enum ExtensibilityCheck { |
1652 PERFORM_EXTENSIBILITY_CHECK, | 1658 PERFORM_EXTENSIBILITY_CHECK, |
1653 OMIT_EXTENSIBILITY_CHECK | 1659 OMIT_EXTENSIBILITY_CHECK |
1654 }; | 1660 }; |
1655 | 1661 |
1656 // Casting. | 1662 // Casting. |
1657 static inline JSReceiver* cast(Object* obj); | 1663 static inline JSReceiver* cast(Object* obj); |
1658 | 1664 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( | 1872 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( |
1867 Name* name, | 1873 Name* name, |
1868 Object* value, | 1874 Object* value, |
1869 PropertyAttributes attributes, | 1875 PropertyAttributes attributes, |
1870 StrictModeFlag strict_mode); | 1876 StrictModeFlag strict_mode); |
1871 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( | 1877 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( |
1872 Name* name, | 1878 Name* name, |
1873 Object* value, | 1879 Object* value, |
1874 PropertyAttributes attributes, | 1880 PropertyAttributes attributes, |
1875 StrictModeFlag strict_mode, | 1881 StrictModeFlag strict_mode, |
1876 ExtensibilityCheck extensibility_check); | 1882 ExtensibilityCheck extensibility_check, |
| 1883 StoreMode mode = ALLOW_AS_CONSTANT); |
1877 | 1884 |
1878 static Handle<Object> SetLocalPropertyIgnoreAttributes( | 1885 static Handle<Object> SetLocalPropertyIgnoreAttributes( |
1879 Handle<JSObject> object, | 1886 Handle<JSObject> object, |
1880 Handle<Name> key, | 1887 Handle<Name> key, |
1881 Handle<Object> value, | 1888 Handle<Object> value, |
1882 PropertyAttributes attributes, | 1889 PropertyAttributes attributes, |
1883 ValueType value_type = OPTIMAL_REPRESENTATION); | 1890 ValueType value_type = OPTIMAL_REPRESENTATION, |
| 1891 StoreMode mode = ALLOW_AS_CONSTANT); |
1884 | 1892 |
1885 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map); | 1893 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map); |
1886 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map); | 1894 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map); |
1887 | 1895 |
1888 // Try to follow an existing transition to a field with attributes NONE. The | 1896 // Try to follow an existing transition to a field with attributes NONE. The |
1889 // return value indicates whether the transition was successful. | 1897 // return value indicates whether the transition was successful. |
1890 static inline Handle<Map> FindTransitionToField(Handle<Map> map, | 1898 static inline Handle<Map> FindTransitionToField(Handle<Map> map, |
1891 Handle<Name> key); | 1899 Handle<Name> key); |
1892 | 1900 |
1893 inline int LastAddedFieldIndex(); | 1901 inline int LastAddedFieldIndex(); |
1894 | 1902 |
1895 // Extend the receiver with a single fast property appeared first in the | 1903 // Extend the receiver with a single fast property appeared first in the |
1896 // passed map. This also extends the property backing store if necessary. | 1904 // passed map. This also extends the property backing store if necessary. |
1897 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); | 1905 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); |
1898 inline MUST_USE_RESULT MaybeObject* AllocateStorageForMap(Map* map); | 1906 inline MUST_USE_RESULT MaybeObject* AllocateStorageForMap(Map* map); |
1899 | 1907 |
1900 static void MigrateInstance(Handle<JSObject> instance); | 1908 static void MigrateInstance(Handle<JSObject> instance); |
1901 inline MUST_USE_RESULT MaybeObject* MigrateInstance(); | 1909 inline MUST_USE_RESULT MaybeObject* MigrateInstance(); |
1902 | 1910 |
1903 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); | 1911 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); |
1904 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance(); | 1912 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance(); |
1905 | 1913 |
1906 // Can cause GC. | 1914 // Can cause GC. |
1907 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( | 1915 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( |
1908 Name* key, | 1916 Name* key, |
1909 Object* value, | 1917 Object* value, |
1910 PropertyAttributes attributes, | 1918 PropertyAttributes attributes, |
1911 ValueType value_type = OPTIMAL_REPRESENTATION); | 1919 ValueType value_type = OPTIMAL_REPRESENTATION, |
| 1920 StoreMode mode = ALLOW_AS_CONSTANT); |
1912 | 1921 |
1913 // Retrieve a value in a normalized object given a lookup result. | 1922 // Retrieve a value in a normalized object given a lookup result. |
1914 // Handles the special representation of JS global objects. | 1923 // Handles the special representation of JS global objects. |
1915 Object* GetNormalizedProperty(LookupResult* result); | 1924 Object* GetNormalizedProperty(LookupResult* result); |
1916 | 1925 |
1917 // Sets the property value in a normalized object given (key, value). | 1926 // Sets the property value in a normalized object given (key, value). |
1918 // Handles the special representation of JS global objects. | 1927 // Handles the special representation of JS global objects. |
1919 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | 1928 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
1920 LookupResult* result, | 1929 LookupResult* result, |
1921 Handle<Object> value); | 1930 Handle<Object> value); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2200 Object* value, | 2209 Object* value, |
2201 int field_index, | 2210 int field_index, |
2202 Representation representation); | 2211 Representation representation); |
2203 | 2212 |
2204 // Add a constant function property to a fast-case object. | 2213 // Add a constant function property to a fast-case object. |
2205 // This leaves a CONSTANT_TRANSITION in the old map, and | 2214 // This leaves a CONSTANT_TRANSITION in the old map, and |
2206 // if it is called on a second object with this map, a | 2215 // if it is called on a second object with this map, a |
2207 // normal property is added instead, with a map transition. | 2216 // normal property is added instead, with a map transition. |
2208 // This avoids the creation of many maps with the same constant | 2217 // This avoids the creation of many maps with the same constant |
2209 // function, all orphaned. | 2218 // function, all orphaned. |
2210 MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( | 2219 MUST_USE_RESULT MaybeObject* AddConstantProperty( |
2211 Name* name, | 2220 Name* name, |
2212 JSFunction* function, | 2221 Object* constant, |
2213 PropertyAttributes attributes); | 2222 PropertyAttributes attributes); |
2214 | 2223 |
2215 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( | 2224 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( |
2216 Name* name, | 2225 Name* name, |
2217 Object* value, | 2226 Object* value, |
2218 PropertyAttributes attributes); | 2227 PropertyAttributes attributes); |
2219 | 2228 |
2220 // Returns a new map with all transitions dropped from the object's current | 2229 // Returns a new map with all transitions dropped from the object's current |
2221 // map and the ElementsKind set. | 2230 // map and the ElementsKind set. |
2222 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, | 2231 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 PropertyAttributes attributes); | 2276 PropertyAttributes attributes); |
2268 | 2277 |
2269 // Add a property to an object. May cause GC. | 2278 // Add a property to an object. May cause GC. |
2270 MUST_USE_RESULT MaybeObject* AddProperty( | 2279 MUST_USE_RESULT MaybeObject* AddProperty( |
2271 Name* name, | 2280 Name* name, |
2272 Object* value, | 2281 Object* value, |
2273 PropertyAttributes attributes, | 2282 PropertyAttributes attributes, |
2274 StrictModeFlag strict_mode, | 2283 StrictModeFlag strict_mode, |
2275 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, | 2284 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
2276 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, | 2285 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, |
2277 ValueType value_type = OPTIMAL_REPRESENTATION); | 2286 ValueType value_type = OPTIMAL_REPRESENTATION, |
| 2287 StoreMode mode = ALLOW_AS_CONSTANT); |
2278 | 2288 |
2279 // Convert the object to use the canonical dictionary | 2289 // Convert the object to use the canonical dictionary |
2280 // representation. If the object is expected to have additional properties | 2290 // representation. If the object is expected to have additional properties |
2281 // added this number can be indicated to have the backing store allocated to | 2291 // added this number can be indicated to have the backing store allocated to |
2282 // an initial capacity for holding these properties. | 2292 // an initial capacity for holding these properties. |
2283 static void NormalizeProperties(Handle<JSObject> object, | 2293 static void NormalizeProperties(Handle<JSObject> object, |
2284 PropertyNormalizationMode mode, | 2294 PropertyNormalizationMode mode, |
2285 int expected_additional_properties); | 2295 int expected_additional_properties); |
2286 | 2296 |
2287 MUST_USE_RESULT MaybeObject* NormalizeProperties( | 2297 MUST_USE_RESULT MaybeObject* NormalizeProperties( |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 // Accessors for fetching instance descriptor at descriptor number. | 2868 // Accessors for fetching instance descriptor at descriptor number. |
2859 inline Name* GetKey(int descriptor_number); | 2869 inline Name* GetKey(int descriptor_number); |
2860 inline Object** GetKeySlot(int descriptor_number); | 2870 inline Object** GetKeySlot(int descriptor_number); |
2861 inline Object* GetValue(int descriptor_number); | 2871 inline Object* GetValue(int descriptor_number); |
2862 inline Object** GetValueSlot(int descriptor_number); | 2872 inline Object** GetValueSlot(int descriptor_number); |
2863 inline Object** GetDescriptorStartSlot(int descriptor_number); | 2873 inline Object** GetDescriptorStartSlot(int descriptor_number); |
2864 inline Object** GetDescriptorEndSlot(int descriptor_number); | 2874 inline Object** GetDescriptorEndSlot(int descriptor_number); |
2865 inline PropertyDetails GetDetails(int descriptor_number); | 2875 inline PropertyDetails GetDetails(int descriptor_number); |
2866 inline PropertyType GetType(int descriptor_number); | 2876 inline PropertyType GetType(int descriptor_number); |
2867 inline int GetFieldIndex(int descriptor_number); | 2877 inline int GetFieldIndex(int descriptor_number); |
2868 inline JSFunction* GetConstantFunction(int descriptor_number); | 2878 inline Object* GetConstant(int descriptor_number); |
2869 inline Object* GetCallbacksObject(int descriptor_number); | 2879 inline Object* GetCallbacksObject(int descriptor_number); |
2870 inline AccessorDescriptor* GetCallbacks(int descriptor_number); | 2880 inline AccessorDescriptor* GetCallbacks(int descriptor_number); |
2871 | 2881 |
2872 inline Name* GetSortedKey(int descriptor_number); | 2882 inline Name* GetSortedKey(int descriptor_number); |
2873 inline int GetSortedKeyIndex(int descriptor_number); | 2883 inline int GetSortedKeyIndex(int descriptor_number); |
2874 inline void SetSortedKey(int pointer, int descriptor_number); | 2884 inline void SetSortedKey(int pointer, int descriptor_number); |
2875 inline void InitializeRepresentations(Representation representation); | 2885 inline void InitializeRepresentations(Representation representation); |
2876 inline void SetRepresentation(int descriptor_number, | 2886 inline void SetRepresentation(int descriptor_number, |
2877 Representation representation); | 2887 Representation representation); |
2878 | 2888 |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4513 // No more than 16 kinds. The value is currently encoded in four bits in | 4523 // No more than 16 kinds. The value is currently encoded in four bits in |
4514 // Flags. | 4524 // Flags. |
4515 STATIC_ASSERT(NUMBER_OF_KINDS <= 16); | 4525 STATIC_ASSERT(NUMBER_OF_KINDS <= 16); |
4516 | 4526 |
4517 static const char* Kind2String(Kind kind); | 4527 static const char* Kind2String(Kind kind); |
4518 | 4528 |
4519 // Types of stubs. | 4529 // Types of stubs. |
4520 enum StubType { | 4530 enum StubType { |
4521 NORMAL, | 4531 NORMAL, |
4522 FIELD, | 4532 FIELD, |
4523 CONSTANT_FUNCTION, | 4533 CONSTANT, |
4524 CALLBACKS, | 4534 CALLBACKS, |
4525 INTERCEPTOR, | 4535 INTERCEPTOR, |
4526 MAP_TRANSITION, | 4536 MAP_TRANSITION, |
4527 NONEXISTENT | 4537 NONEXISTENT |
4528 }; | 4538 }; |
4529 | 4539 |
4530 enum StubHolder { | 4540 enum StubHolder { |
4531 OWN_STUB, | 4541 OWN_STUB, |
4532 PROTOTYPE_STUB | 4542 PROTOTYPE_STUB |
4533 }; | 4543 }; |
(...skipping 22 matching lines...) Expand all Loading... |
4556 void InvalidateRelocation(); | 4566 void InvalidateRelocation(); |
4557 | 4567 |
4558 // [handler_table]: Fixed array containing offsets of exception handlers. | 4568 // [handler_table]: Fixed array containing offsets of exception handlers. |
4559 DECL_ACCESSORS(handler_table, FixedArray) | 4569 DECL_ACCESSORS(handler_table, FixedArray) |
4560 | 4570 |
4561 // [deoptimization_data]: Array containing data for deopt. | 4571 // [deoptimization_data]: Array containing data for deopt. |
4562 DECL_ACCESSORS(deoptimization_data, FixedArray) | 4572 DECL_ACCESSORS(deoptimization_data, FixedArray) |
4563 | 4573 |
4564 // [type_feedback_info]: Struct containing type feedback information for | 4574 // [type_feedback_info]: Struct containing type feedback information for |
4565 // unoptimized code. Optimized code can temporarily store the head of | 4575 // unoptimized code. Optimized code can temporarily store the head of |
4566 // the list of the dependent optimized functions during deoptimization. | 4576 // the list of code to be deoptimized during mark-compact GC. |
4567 // STUBs can use this slot to store arbitrary information as a Smi. | 4577 // STUBs can use this slot to store arbitrary information as a Smi. |
4568 // Will contain either a TypeFeedbackInfo object, or JSFunction object, | 4578 // Will contain either a TypeFeedbackInfo object, or JSFunction object, |
4569 // or undefined, or a Smi. | 4579 // or undefined, or a Smi. |
4570 DECL_ACCESSORS(type_feedback_info, Object) | 4580 DECL_ACCESSORS(type_feedback_info, Object) |
4571 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); | 4581 inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); |
4572 inline int stub_info(); | 4582 inline int stub_info(); |
4573 inline void set_stub_info(int info); | 4583 inline void set_stub_info(int info); |
4574 inline Object* deoptimizing_functions(); | 4584 |
4575 inline void set_deoptimizing_functions(Object* value); | 4585 // Used during GC to code a list of code objects to deoptimize. |
| 4586 inline Object* code_to_deoptimize_link(); |
| 4587 inline void set_code_to_deoptimize_link(Object* value); |
| 4588 inline Object** code_to_deoptimize_link_slot(); |
4576 | 4589 |
4577 // [gc_metadata]: Field used to hold GC related metadata. The contents of this | 4590 // [gc_metadata]: Field used to hold GC related metadata. The contents of this |
4578 // field does not have to be traced during garbage collection since | 4591 // field does not have to be traced during garbage collection since |
4579 // it is only used by the garbage collector itself. | 4592 // it is only used by the garbage collector itself. |
4580 DECL_ACCESSORS(gc_metadata, Object) | 4593 DECL_ACCESSORS(gc_metadata, Object) |
4581 | 4594 |
4582 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age | 4595 // [ic_age]: Inline caching age: the value of the Heap::global_ic_age |
4583 // at the moment when this object was created. | 4596 // at the moment when this object was created. |
4584 inline void set_ic_age(int count); | 4597 inline void set_ic_age(int count); |
4585 inline int ic_age(); | 4598 inline int ic_age(); |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5621 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); | 5634 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); |
5622 return instance_type() >= FIRST_JS_OBJECT_TYPE; | 5635 return instance_type() >= FIRST_JS_OBJECT_TYPE; |
5623 } | 5636 } |
5624 | 5637 |
5625 // Fires when the layout of an object with a leaf map changes. | 5638 // Fires when the layout of an object with a leaf map changes. |
5626 // This includes adding transitions to the leaf map or changing | 5639 // This includes adding transitions to the leaf map or changing |
5627 // the descriptor array. | 5640 // the descriptor array. |
5628 inline void NotifyLeafMapLayoutChange(); | 5641 inline void NotifyLeafMapLayoutChange(); |
5629 | 5642 |
5630 inline bool CanOmitPrototypeChecks(); | 5643 inline bool CanOmitPrototypeChecks(); |
| 5644 inline bool CanOmitMapChecks(); |
5631 | 5645 |
5632 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, | 5646 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
5633 CompilationInfo* info); | 5647 CompilationInfo* info); |
5634 | 5648 |
5635 void AddDependentCode(DependentCode::DependencyGroup group, | 5649 void AddDependentCode(DependentCode::DependencyGroup group, |
5636 Handle<Code> code); | 5650 Handle<Code> code); |
5637 | 5651 |
5638 bool IsMapInArrayPrototypeChain(); | 5652 bool IsMapInArrayPrototypeChain(); |
5639 | 5653 |
5640 // Dispatched behavior. | 5654 // Dispatched behavior. |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6756 // Dispatched behavior. | 6770 // Dispatched behavior. |
6757 DECLARE_PRINTER(JSFunction) | 6771 DECLARE_PRINTER(JSFunction) |
6758 DECLARE_VERIFIER(JSFunction) | 6772 DECLARE_VERIFIER(JSFunction) |
6759 | 6773 |
6760 // Returns the number of allocated literals. | 6774 // Returns the number of allocated literals. |
6761 inline int NumberOfLiterals(); | 6775 inline int NumberOfLiterals(); |
6762 | 6776 |
6763 // Retrieve the native context from a function's literal array. | 6777 // Retrieve the native context from a function's literal array. |
6764 static Context* NativeContextFromLiterals(FixedArray* literals); | 6778 static Context* NativeContextFromLiterals(FixedArray* literals); |
6765 | 6779 |
6766 #ifdef DEBUG | |
6767 bool FunctionsInFunctionListShareSameCode() { | |
6768 Object* current = this; | |
6769 while (!current->IsUndefined()) { | |
6770 JSFunction* function = JSFunction::cast(current); | |
6771 current = function->next_function_link(); | |
6772 if (function->code() != this->code()) return false; | |
6773 } | |
6774 return true; | |
6775 } | |
6776 #endif | |
6777 | |
6778 bool PassesHydrogenFilter(); | 6780 bool PassesHydrogenFilter(); |
6779 | 6781 |
6780 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to | 6782 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to |
6781 // kSize) is weak and has special handling during garbage collection. | 6783 // kSize) is weak and has special handling during garbage collection. |
6782 static const int kCodeEntryOffset = JSObject::kHeaderSize; | 6784 static const int kCodeEntryOffset = JSObject::kHeaderSize; |
6783 static const int kPrototypeOrInitialMapOffset = | 6785 static const int kPrototypeOrInitialMapOffset = |
6784 kCodeEntryOffset + kPointerSize; | 6786 kCodeEntryOffset + kPointerSize; |
6785 static const int kSharedFunctionInfoOffset = | 6787 static const int kSharedFunctionInfoOffset = |
6786 kPrototypeOrInitialMapOffset + kPointerSize; | 6788 kPrototypeOrInitialMapOffset + kPointerSize; |
6787 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; | 6789 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; |
(...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9879 } else { | 9881 } else { |
9880 value &= ~(1 << bit_position); | 9882 value &= ~(1 << bit_position); |
9881 } | 9883 } |
9882 return value; | 9884 return value; |
9883 } | 9885 } |
9884 }; | 9886 }; |
9885 | 9887 |
9886 } } // namespace v8::internal | 9888 } } // namespace v8::internal |
9887 | 9889 |
9888 #endif // V8_OBJECTS_H_ | 9890 #endif // V8_OBJECTS_H_ |
OLD | NEW |