| 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 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( | 1878 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes( |
| 1879 Name* key, | 1879 Name* key, |
| 1880 Object* value, | 1880 Object* value, |
| 1881 PropertyAttributes attributes, | 1881 PropertyAttributes attributes, |
| 1882 ValueType value_type = OPTIMAL_REPRESENTATION); | 1882 ValueType value_type = OPTIMAL_REPRESENTATION); |
| 1883 | 1883 |
| 1884 // Retrieve a value in a normalized object given a lookup result. | 1884 // Retrieve a value in a normalized object given a lookup result. |
| 1885 // Handles the special representation of JS global objects. | 1885 // Handles the special representation of JS global objects. |
| 1886 Object* GetNormalizedProperty(LookupResult* result); | 1886 Object* GetNormalizedProperty(LookupResult* result); |
| 1887 | 1887 |
| 1888 // Sets the property value in a normalized object given (key, value). |
| 1889 // Handles the special representation of JS global objects. |
| 1890 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
| 1891 LookupResult* result, |
| 1892 Handle<Object> value); |
| 1893 |
| 1888 // Sets the property value in a normalized object given a lookup result. | 1894 // Sets the property value in a normalized object given a lookup result. |
| 1889 // Handles the special representation of JS global objects. | 1895 // Handles the special representation of JS global objects. |
| 1890 Object* SetNormalizedProperty(LookupResult* result, Object* value); | 1896 MUST_USE_RESULT MaybeObject* SetNormalizedProperty(LookupResult* result, |
| 1897 Object* value); |
| 1891 | 1898 |
| 1892 // Sets the property value in a normalized object given (key, value, details). | 1899 // Sets the property value in a normalized object given (key, value, details). |
| 1893 // Handles the special representation of JS global objects. | 1900 // Handles the special representation of JS global objects. |
| 1894 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, | 1901 static Handle<Object> SetNormalizedProperty(Handle<JSObject> object, |
| 1895 Handle<Name> key, | 1902 Handle<Name> key, |
| 1896 Handle<Object> value, | 1903 Handle<Object> value, |
| 1897 PropertyDetails details); | 1904 PropertyDetails details); |
| 1898 | 1905 |
| 1899 MUST_USE_RESULT MaybeObject* SetNormalizedProperty(Name* name, | 1906 MUST_USE_RESULT MaybeObject* SetNormalizedProperty(Name* name, |
| 1900 Object* value, | 1907 Object* value, |
| (...skipping 6678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8579 class PropertyCell: public Cell { | 8586 class PropertyCell: public Cell { |
| 8580 public: | 8587 public: |
| 8581 // [type]: type of the global property. | 8588 // [type]: type of the global property. |
| 8582 Type* type(); | 8589 Type* type(); |
| 8583 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 8590 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 8584 | 8591 |
| 8585 // [dependent_code]: dependent code that depends on the type of the global | 8592 // [dependent_code]: dependent code that depends on the type of the global |
| 8586 // property. | 8593 // property. |
| 8587 DECL_ACCESSORS(dependent_code, DependentCode) | 8594 DECL_ACCESSORS(dependent_code, DependentCode) |
| 8588 | 8595 |
| 8596 // Sets the value of the cell and updates the type field to be the union |
| 8597 // of the cell's current type and the value's type. If the change causes |
| 8598 // a change of the type of the cell's contents, code dependent on the cell |
| 8599 // will be deoptimized. |
| 8600 MUST_USE_RESULT MaybeObject* SetValueInferType( |
| 8601 Object* value, |
| 8602 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 8603 |
| 8589 // Casting. | 8604 // Casting. |
| 8590 static inline PropertyCell* cast(Object* obj); | 8605 static inline PropertyCell* cast(Object* obj); |
| 8591 | 8606 |
| 8592 inline Address TypeAddress() { | 8607 inline Address TypeAddress() { |
| 8593 return address() + kTypeOffset; | 8608 return address() + kTypeOffset; |
| 8594 } | 8609 } |
| 8595 | 8610 |
| 8596 // Dispatched behavior. | 8611 // Dispatched behavior. |
| 8597 DECLARE_PRINTER(PropertyCell) | 8612 DECLARE_PRINTER(PropertyCell) |
| 8598 DECLARE_VERIFIER(PropertyCell) | 8613 DECLARE_VERIFIER(PropertyCell) |
| 8599 | 8614 |
| 8600 // Layout description. | 8615 // Layout description. |
| 8601 static const int kTypeOffset = kValueOffset + kPointerSize; | 8616 static const int kTypeOffset = kValueOffset + kPointerSize; |
| 8602 static const int kDependentCodeOffset = kTypeOffset + kPointerSize; | 8617 static const int kDependentCodeOffset = kTypeOffset + kPointerSize; |
| 8603 static const int kSize = kDependentCodeOffset + kPointerSize; | 8618 static const int kSize = kDependentCodeOffset + kPointerSize; |
| 8604 | 8619 |
| 8605 static const int kPointerFieldsBeginOffset = kValueOffset; | 8620 static const int kPointerFieldsBeginOffset = kValueOffset; |
| 8606 static const int kPointerFieldsEndOffset = kDependentCodeOffset; | 8621 static const int kPointerFieldsEndOffset = kDependentCodeOffset; |
| 8607 | 8622 |
| 8608 typedef FixedBodyDescriptor<kValueOffset, | 8623 typedef FixedBodyDescriptor<kValueOffset, |
| 8609 kSize, | 8624 kSize, |
| 8610 kSize> BodyDescriptor; | 8625 kSize> BodyDescriptor; |
| 8611 | 8626 |
| 8612 void AddDependentCompilationInfo(CompilationInfo* info); | 8627 void AddDependentCompilationInfo(CompilationInfo* info); |
| 8613 | 8628 |
| 8614 void AddDependentCode(Handle<Code> code); | 8629 void AddDependentCode(Handle<Code> code); |
| 8615 | 8630 |
| 8631 static Type* UpdateType(Handle<PropertyCell> cell, |
| 8632 Handle<Object> value); |
| 8633 |
| 8616 private: | 8634 private: |
| 8617 DECL_ACCESSORS(type_raw, Object) | 8635 DECL_ACCESSORS(type_raw, Object) |
| 8618 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); | 8636 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); |
| 8619 }; | 8637 }; |
| 8620 | 8638 |
| 8621 | 8639 |
| 8622 // The JSProxy describes EcmaScript Harmony proxies | 8640 // The JSProxy describes EcmaScript Harmony proxies |
| 8623 class JSProxy: public JSReceiver { | 8641 class JSProxy: public JSReceiver { |
| 8624 public: | 8642 public: |
| 8625 // [handler]: The handler property. | 8643 // [handler]: The handler property. |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9746 } else { | 9764 } else { |
| 9747 value &= ~(1 << bit_position); | 9765 value &= ~(1 << bit_position); |
| 9748 } | 9766 } |
| 9749 return value; | 9767 return value; |
| 9750 } | 9768 } |
| 9751 }; | 9769 }; |
| 9752 | 9770 |
| 9753 } } // namespace v8::internal | 9771 } } // namespace v8::internal |
| 9754 | 9772 |
| 9755 #endif // V8_OBJECTS_H_ | 9773 #endif // V8_OBJECTS_H_ |
| OLD | NEW |