| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber); | 1288 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber); |
| 1289 }; | 1289 }; |
| 1290 | 1290 |
| 1291 | 1291 |
| 1292 // The JSObject describes real heap allocated JavaScript objects with | 1292 // The JSObject describes real heap allocated JavaScript objects with |
| 1293 // properties. | 1293 // properties. |
| 1294 // Note that the map of JSObject changes during execution to enable inline | 1294 // Note that the map of JSObject changes during execution to enable inline |
| 1295 // caching. | 1295 // caching. |
| 1296 class JSObject: public HeapObject { | 1296 class JSObject: public HeapObject { |
| 1297 public: | 1297 public: |
| 1298 enum DeleteMode { NORMAL_DELETION, FORCE_DELETION }; | 1298 enum DeleteMode { |
| 1299 NORMAL_DELETION, |
| 1300 STRICT_DELETION, |
| 1301 FORCE_DELETION |
| 1302 }; |
| 1303 |
| 1299 enum ElementsKind { | 1304 enum ElementsKind { |
| 1300 // The only "fast" kind. | 1305 // The only "fast" kind. |
| 1301 FAST_ELEMENTS, | 1306 FAST_ELEMENTS, |
| 1302 // All the kinds below are "slow". | 1307 // All the kinds below are "slow". |
| 1303 DICTIONARY_ELEMENTS, | 1308 DICTIONARY_ELEMENTS, |
| 1304 PIXEL_ELEMENTS, | 1309 PIXEL_ELEMENTS, |
| 1305 EXTERNAL_BYTE_ELEMENTS, | 1310 EXTERNAL_BYTE_ELEMENTS, |
| 1306 EXTERNAL_UNSIGNED_BYTE_ELEMENTS, | 1311 EXTERNAL_UNSIGNED_BYTE_ELEMENTS, |
| 1307 EXTERNAL_SHORT_ELEMENTS, | 1312 EXTERNAL_SHORT_ELEMENTS, |
| 1308 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, | 1313 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 // Collects elements starting at index 0. | 1363 // Collects elements starting at index 0. |
| 1359 // Undefined values are placed after non-undefined values. | 1364 // Undefined values are placed after non-undefined values. |
| 1360 // Returns the number of non-undefined values. | 1365 // Returns the number of non-undefined values. |
| 1361 MUST_USE_RESULT MaybeObject* PrepareElementsForSort(uint32_t limit); | 1366 MUST_USE_RESULT MaybeObject* PrepareElementsForSort(uint32_t limit); |
| 1362 // As PrepareElementsForSort, but only on objects where elements is | 1367 // As PrepareElementsForSort, but only on objects where elements is |
| 1363 // a dictionary, and it will stay a dictionary. | 1368 // a dictionary, and it will stay a dictionary. |
| 1364 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit); | 1369 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit); |
| 1365 | 1370 |
| 1366 MUST_USE_RESULT MaybeObject* SetProperty(String* key, | 1371 MUST_USE_RESULT MaybeObject* SetProperty(String* key, |
| 1367 Object* value, | 1372 Object* value, |
| 1368 PropertyAttributes attributes); | 1373 PropertyAttributes attributes, |
| 1374 StrictModeFlag strict); |
| 1369 MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result, | 1375 MUST_USE_RESULT MaybeObject* SetProperty(LookupResult* result, |
| 1370 String* key, | 1376 String* key, |
| 1371 Object* value, | 1377 Object* value, |
| 1372 PropertyAttributes attributes); | 1378 PropertyAttributes attributes, |
| 1379 StrictModeFlag strict); |
| 1373 MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck( | 1380 MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck( |
| 1374 LookupResult* result, | 1381 LookupResult* result, |
| 1375 String* name, | 1382 String* name, |
| 1376 Object* value, | 1383 Object* value, |
| 1377 bool check_prototype); | 1384 bool check_prototype); |
| 1378 MUST_USE_RESULT MaybeObject* SetPropertyWithCallback(Object* structure, | 1385 MUST_USE_RESULT MaybeObject* SetPropertyWithCallback(Object* structure, |
| 1379 String* name, | 1386 String* name, |
| 1380 Object* value, | 1387 Object* value, |
| 1381 JSObject* holder); | 1388 JSObject* holder); |
| 1382 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSFunction* setter, | 1389 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSFunction* setter, |
| 1383 Object* value); | 1390 Object* value); |
| 1384 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( | 1391 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( |
| 1385 String* name, | 1392 String* name, |
| 1386 Object* value, | 1393 Object* value, |
| 1387 PropertyAttributes attributes); | 1394 PropertyAttributes attributes, |
| 1395 StrictModeFlag strict); |
| 1388 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( | 1396 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( |
| 1389 String* name, | 1397 String* name, |
| 1390 Object* value, | 1398 Object* value, |
| 1391 PropertyAttributes attributes); | 1399 PropertyAttributes attributes, |
| 1400 StrictModeFlag strict); |
| 1392 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( | 1401 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( |
| 1393 String* key, | 1402 String* key, |
| 1394 Object* value, | 1403 Object* value, |
| 1395 PropertyAttributes attributes); | 1404 PropertyAttributes attributes); |
| 1396 | 1405 |
| 1397 // Retrieve a value in a normalized object given a lookup result. | 1406 // Retrieve a value in a normalized object given a lookup result. |
| 1398 // Handles the special representation of JS global objects. | 1407 // Handles the special representation of JS global objects. |
| 1399 Object* GetNormalizedProperty(LookupResult* result); | 1408 Object* GetNormalizedProperty(LookupResult* result); |
| 1400 | 1409 |
| 1401 // Sets the property value in a normalized object given a lookup result. | 1410 // Sets the property value in a normalized object given a lookup result. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 bool check_prototype = true); | 1552 bool check_prototype = true); |
| 1544 | 1553 |
| 1545 // Set the index'th array element. | 1554 // Set the index'th array element. |
| 1546 // A Failure object is returned if GC is needed. | 1555 // A Failure object is returned if GC is needed. |
| 1547 MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, | 1556 MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, |
| 1548 Object* value, | 1557 Object* value, |
| 1549 bool check_prototype = true); | 1558 bool check_prototype = true); |
| 1550 | 1559 |
| 1551 // Returns the index'th element. | 1560 // Returns the index'th element. |
| 1552 // The undefined object if index is out of bounds. | 1561 // The undefined object if index is out of bounds. |
| 1553 MaybeObject* GetElementWithReceiver(JSObject* receiver, uint32_t index); | 1562 MaybeObject* GetElementWithReceiver(Object* receiver, uint32_t index); |
| 1554 MaybeObject* GetElementWithInterceptor(JSObject* receiver, uint32_t index); | 1563 MaybeObject* GetElementWithInterceptor(Object* receiver, uint32_t index); |
| 1564 |
| 1565 // Get external element value at index if there is one and undefined |
| 1566 // otherwise. Can return a failure if allocation of a heap number |
| 1567 // failed. |
| 1568 MaybeObject* GetExternalElement(uint32_t index); |
| 1555 | 1569 |
| 1556 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(int capacity, | 1570 MUST_USE_RESULT MaybeObject* SetFastElementsCapacityAndLength(int capacity, |
| 1557 int length); | 1571 int length); |
| 1558 MUST_USE_RESULT MaybeObject* SetSlowElements(Object* length); | 1572 MUST_USE_RESULT MaybeObject* SetSlowElements(Object* length); |
| 1559 | 1573 |
| 1560 // Lookup interceptors are used for handling properties controlled by host | 1574 // Lookup interceptors are used for handling properties controlled by host |
| 1561 // objects. | 1575 // objects. |
| 1562 inline bool HasNamedInterceptor(); | 1576 inline bool HasNamedInterceptor(); |
| 1563 inline bool HasIndexedInterceptor(); | 1577 inline bool HasIndexedInterceptor(); |
| 1564 | 1578 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1801 Object* value, | 1815 Object* value, |
| 1802 JSObject* holder); | 1816 JSObject* holder); |
| 1803 MUST_USE_RESULT MaybeObject* SetElementWithInterceptor(uint32_t index, | 1817 MUST_USE_RESULT MaybeObject* SetElementWithInterceptor(uint32_t index, |
| 1804 Object* value, | 1818 Object* value, |
| 1805 bool check_prototype); | 1819 bool check_prototype); |
| 1806 MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor( | 1820 MUST_USE_RESULT MaybeObject* SetElementWithoutInterceptor( |
| 1807 uint32_t index, | 1821 uint32_t index, |
| 1808 Object* value, | 1822 Object* value, |
| 1809 bool check_prototype); | 1823 bool check_prototype); |
| 1810 | 1824 |
| 1811 MaybeObject* GetElementPostInterceptor(JSObject* receiver, uint32_t index); | 1825 MaybeObject* GetElementPostInterceptor(Object* receiver, uint32_t index); |
| 1812 | 1826 |
| 1813 MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(String* name, | 1827 MUST_USE_RESULT MaybeObject* DeletePropertyPostInterceptor(String* name, |
| 1814 DeleteMode mode); | 1828 DeleteMode mode); |
| 1815 MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(String* name); | 1829 MUST_USE_RESULT MaybeObject* DeletePropertyWithInterceptor(String* name); |
| 1816 | 1830 |
| 1817 MUST_USE_RESULT MaybeObject* DeleteElementPostInterceptor(uint32_t index, | 1831 MUST_USE_RESULT MaybeObject* DeleteElementPostInterceptor(uint32_t index, |
| 1818 DeleteMode mode); | 1832 DeleteMode mode); |
| 1819 MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index); | 1833 MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index); |
| 1820 | 1834 |
| 1821 PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver, | 1835 PropertyAttributes GetPropertyAttributePostInterceptor(JSObject* receiver, |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3210 | 3224 |
| 3211 typedef int ExtraICState; | 3225 typedef int ExtraICState; |
| 3212 | 3226 |
| 3213 static const ExtraICState kNoExtraICState = 0; | 3227 static const ExtraICState kNoExtraICState = 0; |
| 3214 | 3228 |
| 3215 #ifdef ENABLE_DISASSEMBLER | 3229 #ifdef ENABLE_DISASSEMBLER |
| 3216 // Printing | 3230 // Printing |
| 3217 static const char* Kind2String(Kind kind); | 3231 static const char* Kind2String(Kind kind); |
| 3218 static const char* ICState2String(InlineCacheState state); | 3232 static const char* ICState2String(InlineCacheState state); |
| 3219 static const char* PropertyType2String(PropertyType type); | 3233 static const char* PropertyType2String(PropertyType type); |
| 3234 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra); |
| 3220 inline void Disassemble(const char* name) { | 3235 inline void Disassemble(const char* name) { |
| 3221 Disassemble(name, stdout); | 3236 Disassemble(name, stdout); |
| 3222 } | 3237 } |
| 3223 void Disassemble(const char* name, FILE* out); | 3238 void Disassemble(const char* name, FILE* out); |
| 3224 #endif // ENABLE_DISASSEMBLER | 3239 #endif // ENABLE_DISASSEMBLER |
| 3225 | 3240 |
| 3226 // [instruction_size]: Size of the native instructions | 3241 // [instruction_size]: Size of the native instructions |
| 3227 inline int instruction_size(); | 3242 inline int instruction_size(); |
| 3228 inline void set_instruction_size(int value); | 3243 inline void set_instruction_size(int value); |
| 3229 | 3244 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3603 set_bit_field2(bit_field2() | (1 << kHasFastElements)); | 3618 set_bit_field2(bit_field2() | (1 << kHasFastElements)); |
| 3604 } else { | 3619 } else { |
| 3605 set_bit_field2(bit_field2() & ~(1 << kHasFastElements)); | 3620 set_bit_field2(bit_field2() & ~(1 << kHasFastElements)); |
| 3606 } | 3621 } |
| 3607 } | 3622 } |
| 3608 | 3623 |
| 3609 inline bool has_fast_elements() { | 3624 inline bool has_fast_elements() { |
| 3610 return ((1 << kHasFastElements) & bit_field2()) != 0; | 3625 return ((1 << kHasFastElements) & bit_field2()) != 0; |
| 3611 } | 3626 } |
| 3612 | 3627 |
| 3628 // Tells whether an instance has pixel array elements. |
| 3629 inline void set_has_pixel_array_elements(bool value) { |
| 3630 if (value) { |
| 3631 set_bit_field2(bit_field2() | (1 << kHasPixelArrayElements)); |
| 3632 } else { |
| 3633 set_bit_field2(bit_field2() & ~(1 << kHasPixelArrayElements)); |
| 3634 } |
| 3635 } |
| 3636 |
| 3637 inline bool has_pixel_array_elements() { |
| 3638 return ((1 << kHasPixelArrayElements) & bit_field2()) != 0; |
| 3639 } |
| 3640 |
| 3613 // Tells whether the map is attached to SharedFunctionInfo | 3641 // Tells whether the map is attached to SharedFunctionInfo |
| 3614 // (for inobject slack tracking). | 3642 // (for inobject slack tracking). |
| 3615 inline void set_attached_to_shared_function_info(bool value); | 3643 inline void set_attached_to_shared_function_info(bool value); |
| 3616 | 3644 |
| 3617 inline bool attached_to_shared_function_info(); | 3645 inline bool attached_to_shared_function_info(); |
| 3618 | 3646 |
| 3619 // Tells whether the map is shared between objects that may have different | 3647 // Tells whether the map is shared between objects that may have different |
| 3620 // behavior. If true, the map should never be modified, instead a clone | 3648 // behavior. If true, the map should never be modified, instead a clone |
| 3621 // should be created and modified. | 3649 // should be created and modified. |
| 3622 inline void set_is_shared(bool value); | 3650 inline void set_is_shared(bool value); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3661 // Returns this map if it has the fast elements bit set, otherwise | 3689 // Returns this map if it has the fast elements bit set, otherwise |
| 3662 // returns a copy of the map, with all transitions dropped from the | 3690 // returns a copy of the map, with all transitions dropped from the |
| 3663 // descriptors and the fast elements bit set. | 3691 // descriptors and the fast elements bit set. |
| 3664 MUST_USE_RESULT inline MaybeObject* GetFastElementsMap(); | 3692 MUST_USE_RESULT inline MaybeObject* GetFastElementsMap(); |
| 3665 | 3693 |
| 3666 // Returns this map if it has the fast elements bit cleared, | 3694 // Returns this map if it has the fast elements bit cleared, |
| 3667 // otherwise returns a copy of the map, with all transitions dropped | 3695 // otherwise returns a copy of the map, with all transitions dropped |
| 3668 // from the descriptors and the fast elements bit cleared. | 3696 // from the descriptors and the fast elements bit cleared. |
| 3669 MUST_USE_RESULT inline MaybeObject* GetSlowElementsMap(); | 3697 MUST_USE_RESULT inline MaybeObject* GetSlowElementsMap(); |
| 3670 | 3698 |
| 3699 // Returns this map if it has the pixel array elements bit is set, otherwise |
| 3700 // returns a copy of the map, with all transitions dropped from the |
| 3701 // descriptors and the pixel array elements bit set. |
| 3702 MUST_USE_RESULT inline MaybeObject* GetPixelArrayElementsMap(); |
| 3703 |
| 3671 // Returns the property index for name (only valid for FAST MODE). | 3704 // Returns the property index for name (only valid for FAST MODE). |
| 3672 int PropertyIndexFor(String* name); | 3705 int PropertyIndexFor(String* name); |
| 3673 | 3706 |
| 3674 // Returns the next free property index (only valid for FAST MODE). | 3707 // Returns the next free property index (only valid for FAST MODE). |
| 3675 int NextFreePropertyIndex(); | 3708 int NextFreePropertyIndex(); |
| 3676 | 3709 |
| 3677 // Returns the number of properties described in instance_descriptors. | 3710 // Returns the number of properties described in instance_descriptors. |
| 3678 int NumberOfDescribedProperties(); | 3711 int NumberOfDescribedProperties(); |
| 3679 | 3712 |
| 3680 // Casting. | 3713 // Casting. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3782 static const int kHasInstanceCallHandler = 6; | 3815 static const int kHasInstanceCallHandler = 6; |
| 3783 static const int kIsAccessCheckNeeded = 7; | 3816 static const int kIsAccessCheckNeeded = 7; |
| 3784 | 3817 |
| 3785 // Bit positions for bit field 2 | 3818 // Bit positions for bit field 2 |
| 3786 static const int kIsExtensible = 0; | 3819 static const int kIsExtensible = 0; |
| 3787 static const int kFunctionWithPrototype = 1; | 3820 static const int kFunctionWithPrototype = 1; |
| 3788 static const int kHasFastElements = 2; | 3821 static const int kHasFastElements = 2; |
| 3789 static const int kStringWrapperSafeForDefaultValueOf = 3; | 3822 static const int kStringWrapperSafeForDefaultValueOf = 3; |
| 3790 static const int kAttachedToSharedFunctionInfo = 4; | 3823 static const int kAttachedToSharedFunctionInfo = 4; |
| 3791 static const int kIsShared = 5; | 3824 static const int kIsShared = 5; |
| 3825 static const int kHasPixelArrayElements = 6; |
| 3792 | 3826 |
| 3793 // Layout of the default cache. It holds alternating name and code objects. | 3827 // Layout of the default cache. It holds alternating name and code objects. |
| 3794 static const int kCodeCacheEntrySize = 2; | 3828 static const int kCodeCacheEntrySize = 2; |
| 3795 static const int kCodeCacheEntryNameOffset = 0; | 3829 static const int kCodeCacheEntryNameOffset = 0; |
| 3796 static const int kCodeCacheEntryCodeOffset = 1; | 3830 static const int kCodeCacheEntryCodeOffset = 1; |
| 3797 | 3831 |
| 3798 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, | 3832 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
| 3799 kPointerFieldsEndOffset, | 3833 kPointerFieldsEndOffset, |
| 3800 kSize> BodyDescriptor; | 3834 kSize> BodyDescriptor; |
| 3801 | 3835 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4358 #else | 4392 #else |
| 4359 #error Unknown byte ordering | 4393 #error Unknown byte ordering |
| 4360 #endif | 4394 #endif |
| 4361 | 4395 |
| 4362 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); | 4396 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); |
| 4363 | 4397 |
| 4364 typedef FixedBodyDescriptor<kNameOffset, | 4398 typedef FixedBodyDescriptor<kNameOffset, |
| 4365 kThisPropertyAssignmentsOffset + kPointerSize, | 4399 kThisPropertyAssignmentsOffset + kPointerSize, |
| 4366 kSize> BodyDescriptor; | 4400 kSize> BodyDescriptor; |
| 4367 | 4401 |
| 4368 private: | |
| 4369 // Bit positions in start_position_and_type. | 4402 // Bit positions in start_position_and_type. |
| 4370 // The source code start position is in the 30 most significant bits of | 4403 // The source code start position is in the 30 most significant bits of |
| 4371 // the start_position_and_type field. | 4404 // the start_position_and_type field. |
| 4372 static const int kIsExpressionBit = 0; | 4405 static const int kIsExpressionBit = 0; |
| 4373 static const int kIsTopLevelBit = 1; | 4406 static const int kIsTopLevelBit = 1; |
| 4374 static const int kStartPositionShift = 2; | 4407 static const int kStartPositionShift = 2; |
| 4375 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 4408 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| 4376 | 4409 |
| 4377 // Bit positions in compiler_hints. | 4410 // Bit positions in compiler_hints. |
| 4378 static const int kHasOnlySimpleThisPropertyAssignments = 0; | 4411 static const int kHasOnlySimpleThisPropertyAssignments = 0; |
| 4379 static const int kTryFullCodegen = 1; | 4412 static const int kTryFullCodegen = 1; |
| 4380 static const int kAllowLazyCompilation = 2; | 4413 static const int kAllowLazyCompilation = 2; |
| 4381 static const int kLiveObjectsMayExist = 3; | 4414 static const int kLiveObjectsMayExist = 3; |
| 4382 static const int kCodeAgeShift = 4; | 4415 static const int kCodeAgeShift = 4; |
| 4383 static const int kCodeAgeMask = 0x7; | 4416 static const int kCodeAgeMask = 0x7; |
| 4384 static const int kOptimizationDisabled = 7; | 4417 static const int kOptimizationDisabled = 7; |
| 4385 static const int kStrictModeFunction = 8; | 4418 static const int kStrictModeFunction = 8; |
| 4386 | 4419 |
| 4420 private: |
| 4421 #if V8_HOST_ARCH_32_BIT |
| 4422 // On 32 bit platforms, compiler hints is a smi. |
| 4423 static const int kCompilerHintsSmiTagSize = kSmiTagSize; |
| 4424 static const int kCompilerHintsSize = kPointerSize; |
| 4425 #else |
| 4426 // On 64 bit platforms, compiler hints is not a smi, see comment above. |
| 4427 static const int kCompilerHintsSmiTagSize = 0; |
| 4428 static const int kCompilerHintsSize = kIntSize; |
| 4429 #endif |
| 4430 |
| 4431 public: |
| 4432 // Constants for optimizing codegen for strict mode function tests. |
| 4433 // Allows to use byte-widgh instructions. |
| 4434 static const int kStrictModeBitWithinByte = |
| 4435 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; |
| 4436 |
| 4437 #if __BYTE_ORDER == __LITTLE_ENDIAN |
| 4438 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
| 4439 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; |
| 4440 #elif __BYTE_ORDER == __BIG_ENDIAN |
| 4441 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
| 4442 (kCompilerHintsSize - 1) - |
| 4443 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); |
| 4444 #else |
| 4445 #error Unknown byte ordering |
| 4446 #endif |
| 4447 |
| 4448 private: |
| 4387 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 4449 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
| 4388 }; | 4450 }; |
| 4389 | 4451 |
| 4390 | 4452 |
| 4391 // JSFunction describes JavaScript functions. | 4453 // JSFunction describes JavaScript functions. |
| 4392 class JSFunction: public JSObject { | 4454 class JSFunction: public JSObject { |
| 4393 public: | 4455 public: |
| 4394 // [prototype_or_initial_map]: | 4456 // [prototype_or_initial_map]: |
| 4395 DECL_ACCESSORS(prototype_or_initial_map, Object) | 4457 DECL_ACCESSORS(prototype_or_initial_map, Object) |
| 4396 | 4458 |
| (...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6531 } else { | 6593 } else { |
| 6532 value &= ~(1 << bit_position); | 6594 value &= ~(1 << bit_position); |
| 6533 } | 6595 } |
| 6534 return value; | 6596 return value; |
| 6535 } | 6597 } |
| 6536 }; | 6598 }; |
| 6537 | 6599 |
| 6538 } } // namespace v8::internal | 6600 } } // namespace v8::internal |
| 6539 | 6601 |
| 6540 #endif // V8_OBJECTS_H_ | 6602 #endif // V8_OBJECTS_H_ |
| OLD | NEW |