| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // heap.cc and mark-compact.cc. | 448 // heap.cc and mark-compact.cc. |
| 449 const uint32_t kShortcutTypeMask = | 449 const uint32_t kShortcutTypeMask = |
| 450 kIsNotStringMask | | 450 kIsNotStringMask | |
| 451 kIsSymbolMask | | 451 kIsSymbolMask | |
| 452 kStringRepresentationMask; | 452 kStringRepresentationMask; |
| 453 const uint32_t kShortcutTypeTag = kConsStringTag; | 453 const uint32_t kShortcutTypeTag = kConsStringTag; |
| 454 | 454 |
| 455 | 455 |
| 456 enum InstanceType { | 456 enum InstanceType { |
| 457 // String types. | 457 // String types. |
| 458 // FIRST_STRING_TYPE |
| 458 SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag, | 459 SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag, |
| 459 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag, | 460 ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag, |
| 460 CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag, | 461 CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag, |
| 461 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag, | 462 CONS_ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kConsStringTag, |
| 462 EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag, | 463 EXTERNAL_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kExternalStringTag, |
| 463 EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = | 464 EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE = |
| 464 kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag, | 465 kTwoByteStringTag | kSymbolTag | kExternalStringTag | kAsciiDataHintTag, |
| 465 EXTERNAL_ASCII_SYMBOL_TYPE = | 466 EXTERNAL_ASCII_SYMBOL_TYPE = |
| 466 kAsciiStringTag | kSymbolTag | kExternalStringTag, | 467 kAsciiStringTag | kSymbolTag | kExternalStringTag, |
| 467 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, | 468 STRING_TYPE = kTwoByteStringTag | kSeqStringTag, |
| 468 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag, | 469 ASCII_STRING_TYPE = kAsciiStringTag | kSeqStringTag, |
| 469 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, | 470 CONS_STRING_TYPE = kTwoByteStringTag | kConsStringTag, |
| 470 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag, | 471 CONS_ASCII_STRING_TYPE = kAsciiStringTag | kConsStringTag, |
| 471 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, | 472 EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag, |
| 472 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = | 473 EXTERNAL_STRING_WITH_ASCII_DATA_TYPE = |
| 473 kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag, | 474 kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag, |
| 475 // LAST_STRING_TYPE |
| 474 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag, | 476 EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag, |
| 475 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE, | 477 PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE, |
| 476 | 478 |
| 477 // Objects allocated in their own spaces (never in new space). | 479 // Objects allocated in their own spaces (never in new space). |
| 478 MAP_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE | 480 MAP_TYPE = kNotStringTag, // FIRST_NONSTRING_TYPE |
| 479 CODE_TYPE, | 481 CODE_TYPE, |
| 480 ODDBALL_TYPE, | 482 ODDBALL_TYPE, |
| 481 JS_GLOBAL_PROPERTY_CELL_TYPE, | 483 JS_GLOBAL_PROPERTY_CELL_TYPE, |
| 482 | 484 |
| 483 // "Data", objects that cannot contain non-map-word pointers to heap | 485 // "Data", objects that cannot contain non-map-word pointers to heap |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 FIXED_ARRAY_TYPE, | 518 FIXED_ARRAY_TYPE, |
| 517 SHARED_FUNCTION_INFO_TYPE, | 519 SHARED_FUNCTION_INFO_TYPE, |
| 518 | 520 |
| 519 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE | 521 JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE |
| 520 JS_OBJECT_TYPE, | 522 JS_OBJECT_TYPE, |
| 521 JS_CONTEXT_EXTENSION_OBJECT_TYPE, | 523 JS_CONTEXT_EXTENSION_OBJECT_TYPE, |
| 522 JS_GLOBAL_OBJECT_TYPE, | 524 JS_GLOBAL_OBJECT_TYPE, |
| 523 JS_BUILTINS_OBJECT_TYPE, | 525 JS_BUILTINS_OBJECT_TYPE, |
| 524 JS_GLOBAL_PROXY_TYPE, | 526 JS_GLOBAL_PROXY_TYPE, |
| 525 JS_ARRAY_TYPE, | 527 JS_ARRAY_TYPE, |
| 526 JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE | 528 |
| 529 JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE, FIRST_FUNCTION_CLASS_TYPE |
| 527 | 530 |
| 528 JS_FUNCTION_TYPE, | 531 JS_FUNCTION_TYPE, |
| 529 | 532 |
| 530 // Pseudo-types | 533 // Pseudo-types |
| 531 FIRST_TYPE = 0x0, | 534 FIRST_TYPE = 0x0, |
| 532 LAST_TYPE = JS_FUNCTION_TYPE, | 535 LAST_TYPE = JS_FUNCTION_TYPE, |
| 533 INVALID_TYPE = FIRST_TYPE - 1, | 536 INVALID_TYPE = FIRST_TYPE - 1, |
| 534 FIRST_NONSTRING_TYPE = MAP_TYPE, | 537 FIRST_NONSTRING_TYPE = MAP_TYPE, |
| 538 FIRST_STRING_TYPE = FIRST_TYPE, |
| 539 LAST_STRING_TYPE = FIRST_NONSTRING_TYPE - 1, |
| 535 // Boundaries for testing for an external array. | 540 // Boundaries for testing for an external array. |
| 536 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE, | 541 FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE, |
| 537 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE, | 542 LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE, |
| 538 // Boundary for promotion to old data space/old pointer space. | 543 // Boundary for promotion to old data space/old pointer space. |
| 539 LAST_DATA_TYPE = FILLER_TYPE, | 544 LAST_DATA_TYPE = FILLER_TYPE, |
| 540 // Boundaries for testing the type is a JavaScript "object". Note that | 545 // Boundaries for testing the type is a JavaScript "object". Note that |
| 541 // function objects are not counted as objects, even though they are | 546 // function objects are not counted as objects, even though they are |
| 542 // implemented as such; only values whose typeof is "object" are included. | 547 // implemented as such; only values whose typeof is "object" are included. |
| 543 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, | 548 FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE, |
| 544 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE | 549 LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE, |
| 550 // RegExp objects have [[Class]] "function" because they are callable. |
| 551 // All types from this type and above are objects with [[Class]] "function". |
| 552 FIRST_FUNCTION_CLASS_TYPE = JS_REGEXP_TYPE |
| 545 }; | 553 }; |
| 546 | 554 |
| 547 | 555 |
| 548 STATIC_CHECK(JS_OBJECT_TYPE == Internals::kJSObjectType); | 556 STATIC_CHECK(JS_OBJECT_TYPE == Internals::kJSObjectType); |
| 549 STATIC_CHECK(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); | 557 STATIC_CHECK(FIRST_NONSTRING_TYPE == Internals::kFirstNonstringType); |
| 550 STATIC_CHECK(PROXY_TYPE == Internals::kProxyType); | 558 STATIC_CHECK(PROXY_TYPE == Internals::kProxyType); |
| 551 | 559 |
| 552 | 560 |
| 553 enum CompareResult { | 561 enum CompareResult { |
| 554 LESS = -1, | 562 LESS = -1, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 625 } |
| 618 void Print(FILE* out); | 626 void Print(FILE* out); |
| 619 void PrintLn(FILE* out); | 627 void PrintLn(FILE* out); |
| 620 #endif | 628 #endif |
| 621 #ifdef DEBUG | 629 #ifdef DEBUG |
| 622 // Verifies the object. | 630 // Verifies the object. |
| 623 void Verify(); | 631 void Verify(); |
| 624 #endif | 632 #endif |
| 625 }; | 633 }; |
| 626 | 634 |
| 635 |
| 636 #define OBJECT_TYPE_LIST(V) \ |
| 637 V(Smi) \ |
| 638 V(HeapObject) \ |
| 639 V(Number) \ |
| 640 |
| 641 #define HEAP_OBJECT_TYPE_LIST(V) \ |
| 642 V(HeapNumber) \ |
| 643 V(String) \ |
| 644 V(Symbol) \ |
| 645 V(SeqString) \ |
| 646 V(ExternalString) \ |
| 647 V(ConsString) \ |
| 648 V(ExternalTwoByteString) \ |
| 649 V(ExternalAsciiString) \ |
| 650 V(SeqTwoByteString) \ |
| 651 V(SeqAsciiString) \ |
| 652 \ |
| 653 V(PixelArray) \ |
| 654 V(ExternalArray) \ |
| 655 V(ExternalByteArray) \ |
| 656 V(ExternalUnsignedByteArray) \ |
| 657 V(ExternalShortArray) \ |
| 658 V(ExternalUnsignedShortArray) \ |
| 659 V(ExternalIntArray) \ |
| 660 V(ExternalUnsignedIntArray) \ |
| 661 V(ExternalFloatArray) \ |
| 662 V(ByteArray) \ |
| 663 V(JSObject) \ |
| 664 V(JSContextExtensionObject) \ |
| 665 V(Map) \ |
| 666 V(DescriptorArray) \ |
| 667 V(DeoptimizationInputData) \ |
| 668 V(DeoptimizationOutputData) \ |
| 669 V(FixedArray) \ |
| 670 V(Context) \ |
| 671 V(CatchContext) \ |
| 672 V(GlobalContext) \ |
| 673 V(JSFunction) \ |
| 674 V(Code) \ |
| 675 V(Oddball) \ |
| 676 V(SharedFunctionInfo) \ |
| 677 V(JSValue) \ |
| 678 V(StringWrapper) \ |
| 679 V(Proxy) \ |
| 680 V(Boolean) \ |
| 681 V(JSArray) \ |
| 682 V(JSRegExp) \ |
| 683 V(HashTable) \ |
| 684 V(Dictionary) \ |
| 685 V(SymbolTable) \ |
| 686 V(JSFunctionResultCache) \ |
| 687 V(NormalizedMapCache) \ |
| 688 V(CompilationCacheTable) \ |
| 689 V(CodeCacheHashTable) \ |
| 690 V(MapCache) \ |
| 691 V(Primitive) \ |
| 692 V(GlobalObject) \ |
| 693 V(JSGlobalObject) \ |
| 694 V(JSBuiltinsObject) \ |
| 695 V(JSGlobalProxy) \ |
| 696 V(UndetectableObject) \ |
| 697 V(AccessCheckNeeded) \ |
| 698 V(JSGlobalPropertyCell) \ |
| 699 |
| 627 // Object is the abstract superclass for all classes in the | 700 // Object is the abstract superclass for all classes in the |
| 628 // object hierarchy. | 701 // object hierarchy. |
| 629 // Object does not use any virtual functions to avoid the | 702 // Object does not use any virtual functions to avoid the |
| 630 // allocation of the C++ vtable. | 703 // allocation of the C++ vtable. |
| 631 // Since Smi and Failure are subclasses of Object no | 704 // Since Smi and Failure are subclasses of Object no |
| 632 // data members can be present in Object. | 705 // data members can be present in Object. |
| 633 class Object : public MaybeObject { | 706 class Object : public MaybeObject { |
| 634 public: | 707 public: |
| 635 // Type testing. | 708 // Type testing. |
| 636 inline bool IsSmi(); | 709 #define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_(); |
| 637 inline bool IsHeapObject(); | 710 OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
| 638 inline bool IsHeapNumber(); | 711 HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) |
| 639 inline bool IsString(); | 712 #undef IS_TYPE_FUNCTION_DECL |
| 640 inline bool IsSymbol(); | |
| 641 // See objects-inl.h for more details | |
| 642 inline bool IsSeqString(); | |
| 643 inline bool IsExternalString(); | |
| 644 inline bool IsExternalTwoByteString(); | |
| 645 inline bool IsExternalAsciiString(); | |
| 646 inline bool IsSeqTwoByteString(); | |
| 647 inline bool IsSeqAsciiString(); | |
| 648 inline bool IsConsString(); | |
| 649 | |
| 650 inline bool IsNumber(); | |
| 651 inline bool IsByteArray(); | |
| 652 inline bool IsPixelArray(); | |
| 653 inline bool IsExternalArray(); | |
| 654 inline bool IsExternalByteArray(); | |
| 655 inline bool IsExternalUnsignedByteArray(); | |
| 656 inline bool IsExternalShortArray(); | |
| 657 inline bool IsExternalUnsignedShortArray(); | |
| 658 inline bool IsExternalIntArray(); | |
| 659 inline bool IsExternalUnsignedIntArray(); | |
| 660 inline bool IsExternalFloatArray(); | |
| 661 inline bool IsJSObject(); | |
| 662 inline bool IsJSContextExtensionObject(); | |
| 663 inline bool IsMap(); | |
| 664 inline bool IsFixedArray(); | |
| 665 inline bool IsDescriptorArray(); | |
| 666 inline bool IsDeoptimizationInputData(); | |
| 667 inline bool IsDeoptimizationOutputData(); | |
| 668 inline bool IsContext(); | |
| 669 inline bool IsCatchContext(); | |
| 670 inline bool IsGlobalContext(); | |
| 671 inline bool IsJSFunction(); | |
| 672 inline bool IsCode(); | |
| 673 inline bool IsOddball(); | |
| 674 inline bool IsSharedFunctionInfo(); | |
| 675 inline bool IsJSValue(); | |
| 676 inline bool IsStringWrapper(); | |
| 677 inline bool IsProxy(); | |
| 678 inline bool IsBoolean(); | |
| 679 inline bool IsJSArray(); | |
| 680 inline bool IsJSRegExp(); | |
| 681 inline bool IsHashTable(); | |
| 682 inline bool IsDictionary(); | |
| 683 inline bool IsSymbolTable(); | |
| 684 inline bool IsJSFunctionResultCache(); | |
| 685 inline bool IsNormalizedMapCache(); | |
| 686 inline bool IsCompilationCacheTable(); | |
| 687 inline bool IsCodeCacheHashTable(); | |
| 688 inline bool IsMapCache(); | |
| 689 inline bool IsPrimitive(); | |
| 690 inline bool IsGlobalObject(); | |
| 691 inline bool IsJSGlobalObject(); | |
| 692 inline bool IsJSBuiltinsObject(); | |
| 693 inline bool IsJSGlobalProxy(); | |
| 694 inline bool IsUndetectableObject(); | |
| 695 inline bool IsAccessCheckNeeded(); | |
| 696 inline bool IsJSGlobalPropertyCell(); | |
| 697 | 713 |
| 698 // Returns true if this object is an instance of the specified | 714 // Returns true if this object is an instance of the specified |
| 699 // function template. | 715 // function template. |
| 700 inline bool IsInstanceOf(FunctionTemplateInfo* type); | 716 inline bool IsInstanceOf(FunctionTemplateInfo* type); |
| 701 | 717 |
| 702 inline bool IsStruct(); | 718 inline bool IsStruct(); |
| 703 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); | 719 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name(); |
| 704 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) | 720 STRUCT_LIST(DECLARE_STRUCT_PREDICATE) |
| 705 #undef DECLARE_STRUCT_PREDICATE | 721 #undef DECLARE_STRUCT_PREDICATE |
| 706 | 722 |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2623 | 2639 |
| 2624 static const int kEntrySize = 2; // key + value | 2640 static const int kEntrySize = 2; // key + value |
| 2625 | 2641 |
| 2626 static const int kFactoryOffset = kHeaderSize; | 2642 static const int kFactoryOffset = kHeaderSize; |
| 2627 static const int kFingerOffset = kFactoryOffset + kPointerSize; | 2643 static const int kFingerOffset = kFactoryOffset + kPointerSize; |
| 2628 static const int kCacheSizeOffset = kFingerOffset + kPointerSize; | 2644 static const int kCacheSizeOffset = kFingerOffset + kPointerSize; |
| 2629 | 2645 |
| 2630 inline void MakeZeroSize(); | 2646 inline void MakeZeroSize(); |
| 2631 inline void Clear(); | 2647 inline void Clear(); |
| 2632 | 2648 |
| 2649 inline int size(); |
| 2650 inline void set_size(int size); |
| 2651 inline int finger_index(); |
| 2652 inline void set_finger_index(int finger_index); |
| 2653 |
| 2633 // Casting | 2654 // Casting |
| 2634 static inline JSFunctionResultCache* cast(Object* obj); | 2655 static inline JSFunctionResultCache* cast(Object* obj); |
| 2635 | 2656 |
| 2636 #ifdef DEBUG | 2657 #ifdef DEBUG |
| 2637 void JSFunctionResultCacheVerify(); | 2658 void JSFunctionResultCacheVerify(); |
| 2638 #endif | 2659 #endif |
| 2639 }; | 2660 }; |
| 2640 | 2661 |
| 2641 | 2662 |
| 2642 // The cache for maps used by normalized (dictionary mode) objects. | 2663 // The cache for maps used by normalized (dictionary mode) objects. |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3173 // Pseudo-kinds. | 3194 // Pseudo-kinds. |
| 3174 REGEXP = BUILTIN, | 3195 REGEXP = BUILTIN, |
| 3175 FIRST_IC_KIND = LOAD_IC, | 3196 FIRST_IC_KIND = LOAD_IC, |
| 3176 LAST_IC_KIND = COMPARE_IC | 3197 LAST_IC_KIND = COMPARE_IC |
| 3177 }; | 3198 }; |
| 3178 | 3199 |
| 3179 enum { | 3200 enum { |
| 3180 NUMBER_OF_KINDS = LAST_IC_KIND + 1 | 3201 NUMBER_OF_KINDS = LAST_IC_KIND + 1 |
| 3181 }; | 3202 }; |
| 3182 | 3203 |
| 3204 typedef int ExtraICState; |
| 3205 |
| 3206 static const ExtraICState kNoExtraICState = 0; |
| 3207 |
| 3183 #ifdef ENABLE_DISASSEMBLER | 3208 #ifdef ENABLE_DISASSEMBLER |
| 3184 // Printing | 3209 // Printing |
| 3185 static const char* Kind2String(Kind kind); | 3210 static const char* Kind2String(Kind kind); |
| 3186 static const char* ICState2String(InlineCacheState state); | 3211 static const char* ICState2String(InlineCacheState state); |
| 3187 static const char* PropertyType2String(PropertyType type); | 3212 static const char* PropertyType2String(PropertyType type); |
| 3188 inline void Disassemble(const char* name) { | 3213 inline void Disassemble(const char* name) { |
| 3189 Disassemble(name, stdout); | 3214 Disassemble(name, stdout); |
| 3190 } | 3215 } |
| 3191 void Disassemble(const char* name, FILE* out); | 3216 void Disassemble(const char* name, FILE* out); |
| 3192 #endif // ENABLE_DISASSEMBLER | 3217 #endif // ENABLE_DISASSEMBLER |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3208 | 3233 |
| 3209 inline int relocation_size(); | 3234 inline int relocation_size(); |
| 3210 | 3235 |
| 3211 // [flags]: Various code flags. | 3236 // [flags]: Various code flags. |
| 3212 inline Flags flags(); | 3237 inline Flags flags(); |
| 3213 inline void set_flags(Flags flags); | 3238 inline void set_flags(Flags flags); |
| 3214 | 3239 |
| 3215 // [flags]: Access to specific code flags. | 3240 // [flags]: Access to specific code flags. |
| 3216 inline Kind kind(); | 3241 inline Kind kind(); |
| 3217 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 3242 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
| 3243 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
| 3218 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. | 3244 inline InLoopFlag ic_in_loop(); // Only valid for IC stubs. |
| 3219 inline PropertyType type(); // Only valid for monomorphic IC stubs. | 3245 inline PropertyType type(); // Only valid for monomorphic IC stubs. |
| 3220 inline int arguments_count(); // Only valid for call IC stubs. | 3246 inline int arguments_count(); // Only valid for call IC stubs. |
| 3221 | 3247 |
| 3222 // Testers for IC stub kinds. | 3248 // Testers for IC stub kinds. |
| 3223 inline bool is_inline_cache_stub(); | 3249 inline bool is_inline_cache_stub(); |
| 3224 inline bool is_load_stub() { return kind() == LOAD_IC; } | 3250 inline bool is_load_stub() { return kind() == LOAD_IC; } |
| 3225 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 3251 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
| 3226 inline bool is_store_stub() { return kind() == STORE_IC; } | 3252 inline bool is_store_stub() { return kind() == STORE_IC; } |
| 3227 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 3253 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3292 SafepointEntry GetSafepointEntry(Address pc); | 3318 SafepointEntry GetSafepointEntry(Address pc); |
| 3293 | 3319 |
| 3294 // Mark this code object as not having a stack check table. Assumes kind | 3320 // Mark this code object as not having a stack check table. Assumes kind |
| 3295 // is FUNCTION. | 3321 // is FUNCTION. |
| 3296 void SetNoStackCheckTable(); | 3322 void SetNoStackCheckTable(); |
| 3297 | 3323 |
| 3298 // Find the first map in an IC stub. | 3324 // Find the first map in an IC stub. |
| 3299 Map* FindFirstMap(); | 3325 Map* FindFirstMap(); |
| 3300 | 3326 |
| 3301 // Flags operations. | 3327 // Flags operations. |
| 3302 static inline Flags ComputeFlags(Kind kind, | 3328 static inline Flags ComputeFlags( |
| 3303 InLoopFlag in_loop = NOT_IN_LOOP, | 3329 Kind kind, |
| 3304 InlineCacheState ic_state = UNINITIALIZED, | 3330 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3305 PropertyType type = NORMAL, | 3331 InlineCacheState ic_state = UNINITIALIZED, |
| 3306 int argc = -1, | 3332 ExtraICState extra_ic_state = kNoExtraICState, |
| 3307 InlineCacheHolderFlag holder = OWN_MAP); | 3333 PropertyType type = NORMAL, |
| 3334 int argc = -1, |
| 3335 InlineCacheHolderFlag holder = OWN_MAP); |
| 3308 | 3336 |
| 3309 static inline Flags ComputeMonomorphicFlags( | 3337 static inline Flags ComputeMonomorphicFlags( |
| 3310 Kind kind, | 3338 Kind kind, |
| 3311 PropertyType type, | 3339 PropertyType type, |
| 3340 ExtraICState extra_ic_state = kNoExtraICState, |
| 3312 InlineCacheHolderFlag holder = OWN_MAP, | 3341 InlineCacheHolderFlag holder = OWN_MAP, |
| 3313 InLoopFlag in_loop = NOT_IN_LOOP, | 3342 InLoopFlag in_loop = NOT_IN_LOOP, |
| 3314 int argc = -1); | 3343 int argc = -1); |
| 3315 | 3344 |
| 3316 static inline Kind ExtractKindFromFlags(Flags flags); | 3345 static inline Kind ExtractKindFromFlags(Flags flags); |
| 3317 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 3346 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
| 3347 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
| 3318 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); | 3348 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); |
| 3319 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 3349 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
| 3320 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 3350 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
| 3321 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 3351 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
| 3322 static inline Flags RemoveTypeFromFlags(Flags flags); | 3352 static inline Flags RemoveTypeFromFlags(Flags flags); |
| 3323 | 3353 |
| 3324 // Convert a target address into a code object. | 3354 // Convert a target address into a code object. |
| 3325 static inline Code* GetCodeFromTargetAddress(Address address); | 3355 static inline Code* GetCodeFromTargetAddress(Address address); |
| 3326 | 3356 |
| 3327 // Convert an entry address into an object. | 3357 // Convert an entry address into an object. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3428 | 3458 |
| 3429 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; | 3459 static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3430 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; | 3460 static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize; |
| 3431 | 3461 |
| 3432 // Flags layout. | 3462 // Flags layout. |
| 3433 static const int kFlagsICStateShift = 0; | 3463 static const int kFlagsICStateShift = 0; |
| 3434 static const int kFlagsICInLoopShift = 3; | 3464 static const int kFlagsICInLoopShift = 3; |
| 3435 static const int kFlagsTypeShift = 4; | 3465 static const int kFlagsTypeShift = 4; |
| 3436 static const int kFlagsKindShift = 7; | 3466 static const int kFlagsKindShift = 7; |
| 3437 static const int kFlagsICHolderShift = 11; | 3467 static const int kFlagsICHolderShift = 11; |
| 3438 static const int kFlagsArgumentsCountShift = 12; | 3468 static const int kFlagsExtraICStateShift = 12; |
| 3469 static const int kFlagsArgumentsCountShift = 14; |
| 3439 | 3470 |
| 3440 static const int kFlagsICStateMask = 0x00000007; // 00000000111 | 3471 static const int kFlagsICStateMask = 0x00000007; // 00000000111 |
| 3441 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 | 3472 static const int kFlagsICInLoopMask = 0x00000008; // 00000001000 |
| 3442 static const int kFlagsTypeMask = 0x00000070; // 00001110000 | 3473 static const int kFlagsTypeMask = 0x00000070; // 00001110000 |
| 3443 static const int kFlagsKindMask = 0x00000780; // 11110000000 | 3474 static const int kFlagsKindMask = 0x00000780; // 11110000000 |
| 3444 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; | 3475 static const int kFlagsCacheInPrototypeMapMask = 0x00000800; |
| 3445 static const int kFlagsArgumentsCountMask = 0xFFFFF000; | 3476 static const int kFlagsExtraICStateMask = 0x00003000; |
| 3477 static const int kFlagsArgumentsCountMask = 0xFFFFC000; |
| 3446 | 3478 |
| 3447 static const int kFlagsNotUsedInLookup = | 3479 static const int kFlagsNotUsedInLookup = |
| 3448 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); | 3480 (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask); |
| 3449 | 3481 |
| 3450 private: | 3482 private: |
| 3451 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); | 3483 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); |
| 3452 }; | 3484 }; |
| 3453 | 3485 |
| 3454 | 3486 |
| 3455 // All heap objects have a Map that describes their structure. | 3487 // All heap objects have a Map that describes their structure. |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4055 // Currently it either has FunctionTemplateInfo to make benefit the API | 4087 // Currently it either has FunctionTemplateInfo to make benefit the API |
| 4056 // or Smi identifying a builtin function. | 4088 // or Smi identifying a builtin function. |
| 4057 // In the long run we don't want all functions to have this field but | 4089 // In the long run we don't want all functions to have this field but |
| 4058 // we can fix that when we have a better model for storing hidden data | 4090 // we can fix that when we have a better model for storing hidden data |
| 4059 // on objects. | 4091 // on objects. |
| 4060 DECL_ACCESSORS(function_data, Object) | 4092 DECL_ACCESSORS(function_data, Object) |
| 4061 | 4093 |
| 4062 inline bool IsApiFunction(); | 4094 inline bool IsApiFunction(); |
| 4063 inline FunctionTemplateInfo* get_api_func_data(); | 4095 inline FunctionTemplateInfo* get_api_func_data(); |
| 4064 inline bool HasBuiltinFunctionId(); | 4096 inline bool HasBuiltinFunctionId(); |
| 4065 inline bool IsBuiltinMathFunction(); | |
| 4066 inline BuiltinFunctionId builtin_function_id(); | 4097 inline BuiltinFunctionId builtin_function_id(); |
| 4067 | 4098 |
| 4068 // [script info]: Script from which the function originates. | 4099 // [script info]: Script from which the function originates. |
| 4069 DECL_ACCESSORS(script, Object) | 4100 DECL_ACCESSORS(script, Object) |
| 4070 | 4101 |
| 4071 // [num_literals]: Number of literals used by this function. | 4102 // [num_literals]: Number of literals used by this function. |
| 4072 inline int num_literals(); | 4103 inline int num_literals(); |
| 4073 inline void set_num_literals(int value); | 4104 inline void set_num_literals(int value); |
| 4074 | 4105 |
| 4075 // [start_position_and_type]: Field used to store both the source code | 4106 // [start_position_and_type]: Field used to store both the source code |
| (...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6424 } else { | 6455 } else { |
| 6425 value &= ~(1 << bit_position); | 6456 value &= ~(1 << bit_position); |
| 6426 } | 6457 } |
| 6427 return value; | 6458 return value; |
| 6428 } | 6459 } |
| 6429 }; | 6460 }; |
| 6430 | 6461 |
| 6431 } } // namespace v8::internal | 6462 } } // namespace v8::internal |
| 6432 | 6463 |
| 6433 #endif // V8_OBJECTS_H_ | 6464 #endif // V8_OBJECTS_H_ |
| OLD | NEW |