| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 6732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6743 // script's origin. V8 just passes this through. Encoded in | 6743 // script's origin. V8 just passes this through. Encoded in |
| 6744 // the 'flags' field. | 6744 // the 'flags' field. |
| 6745 DECL_BOOLEAN_ACCESSORS(is_embedder_debug_script) | 6745 DECL_BOOLEAN_ACCESSORS(is_embedder_debug_script) |
| 6746 | 6746 |
| 6747 // [is_shared_cross_origin]: An opaque boolean set by the embedder via | 6747 // [is_shared_cross_origin]: An opaque boolean set by the embedder via |
| 6748 // ScriptOrigin, and used by the embedder to make decisions about the | 6748 // ScriptOrigin, and used by the embedder to make decisions about the |
| 6749 // script's level of privilege. V8 just passes this through. Encoded in | 6749 // script's level of privilege. V8 just passes this through. Encoded in |
| 6750 // the 'flags' field. | 6750 // the 'flags' field. |
| 6751 DECL_BOOLEAN_ACCESSORS(is_shared_cross_origin) | 6751 DECL_BOOLEAN_ACCESSORS(is_shared_cross_origin) |
| 6752 | 6752 |
| 6753 // [is_opaque]: An opaque boolean set by the embedder via ScriptOrigin, and |
| 6754 // used by the embedder to make decisions about the opaqueness of script. V8 |
| 6755 // just passes this through. Encoded in the 'flags' field. |
| 6756 DECL_BOOLEAN_ACCESSORS(is_opaque) |
| 6757 |
| 6753 DECLARE_CAST(Script) | 6758 DECLARE_CAST(Script) |
| 6754 | 6759 |
| 6755 // If script source is an external string, check that the underlying | 6760 // If script source is an external string, check that the underlying |
| 6756 // resource is accessible. Otherwise, always return true. | 6761 // resource is accessible. Otherwise, always return true. |
| 6757 inline bool HasValidSource(); | 6762 inline bool HasValidSource(); |
| 6758 | 6763 |
| 6759 // Convert code position into column number. | 6764 // Convert code position into column number. |
| 6760 static int GetColumnNumber(Handle<Script> script, int code_pos); | 6765 static int GetColumnNumber(Handle<Script> script, int code_pos); |
| 6761 | 6766 |
| 6762 // Convert code position into (zero-based) line number. | 6767 // Convert code position into (zero-based) line number. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6795 static const int kSize = kSourceMappingUrlOffset + kPointerSize; | 6800 static const int kSize = kSourceMappingUrlOffset + kPointerSize; |
| 6796 | 6801 |
| 6797 private: | 6802 private: |
| 6798 int GetLineNumberWithArray(int code_pos); | 6803 int GetLineNumberWithArray(int code_pos); |
| 6799 | 6804 |
| 6800 // Bit positions in the flags field. | 6805 // Bit positions in the flags field. |
| 6801 static const int kCompilationTypeBit = 0; | 6806 static const int kCompilationTypeBit = 0; |
| 6802 static const int kCompilationStateBit = 1; | 6807 static const int kCompilationStateBit = 1; |
| 6803 static const int kIsEmbedderDebugScriptBit = 2; | 6808 static const int kIsEmbedderDebugScriptBit = 2; |
| 6804 static const int kIsSharedCrossOriginBit = 3; | 6809 static const int kIsSharedCrossOriginBit = 3; |
| 6810 static const int kIsOpaqueBit = 4; |
| 6805 | 6811 |
| 6806 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 6812 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
| 6807 }; | 6813 }; |
| 6808 | 6814 |
| 6809 | 6815 |
| 6810 // List of builtin functions we want to identify to improve code | 6816 // List of builtin functions we want to identify to improve code |
| 6811 // generation. | 6817 // generation. |
| 6812 // | 6818 // |
| 6813 // Each entry has a name of a global object property holding an object | 6819 // Each entry has a name of a global object property holding an object |
| 6814 // optionally followed by ".prototype", a name of a builtin function | 6820 // optionally followed by ".prototype", a name of a builtin function |
| (...skipping 3726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10541 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10547 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
| 10542 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 10548 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
| 10543 | 10549 |
| 10544 private: | 10550 private: |
| 10545 inline bool HasExpectedReceiverType() { | 10551 inline bool HasExpectedReceiverType() { |
| 10546 return expected_receiver_type()->IsFunctionTemplateInfo(); | 10552 return expected_receiver_type()->IsFunctionTemplateInfo(); |
| 10547 } | 10553 } |
| 10548 // Bit positions in flag. | 10554 // Bit positions in flag. |
| 10549 static const int kAllCanReadBit = 0; | 10555 static const int kAllCanReadBit = 0; |
| 10550 static const int kAllCanWriteBit = 1; | 10556 static const int kAllCanWriteBit = 1; |
| 10551 class AttributesField: public BitField<PropertyAttributes, 2, 3> {}; | 10557 class AttributesField : public BitField<PropertyAttributes, 2, 3> {}; |
| 10552 | 10558 |
| 10553 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); | 10559 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); |
| 10554 }; | 10560 }; |
| 10555 | 10561 |
| 10556 | 10562 |
| 10557 // An accessor must have a getter, but can have no setter. | 10563 // An accessor must have a getter, but can have no setter. |
| 10558 // | 10564 // |
| 10559 // When setting a property, V8 searches accessors in prototypes. | 10565 // When setting a property, V8 searches accessors in prototypes. |
| 10560 // If an accessor was found and it does not have a setter, | 10566 // If an accessor was found and it does not have a setter, |
| 10561 // the request is ignored. | 10567 // the request is ignored. |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11111 } else { | 11117 } else { |
| 11112 value &= ~(1 << bit_position); | 11118 value &= ~(1 << bit_position); |
| 11113 } | 11119 } |
| 11114 return value; | 11120 return value; |
| 11115 } | 11121 } |
| 11116 }; | 11122 }; |
| 11117 | 11123 |
| 11118 } } // namespace v8::internal | 11124 } } // namespace v8::internal |
| 11119 | 11125 |
| 11120 #endif // V8_OBJECTS_H_ | 11126 #endif // V8_OBJECTS_H_ |
| OLD | NEW |