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 9173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9184 | 9184 |
9185 // [dependent_code]: dependent code that depends on the type of the global | 9185 // [dependent_code]: dependent code that depends on the type of the global |
9186 // property. | 9186 // property. |
9187 DECL_ACCESSORS(dependent_code, DependentCode) | 9187 DECL_ACCESSORS(dependent_code, DependentCode) |
9188 | 9188 |
9189 // Sets the value of the cell and updates the type field to be the union | 9189 // Sets the value of the cell and updates the type field to be the union |
9190 // of the cell's current type and the value's type. If the change causes | 9190 // of the cell's current type and the value's type. If the change causes |
9191 // a change of the type of the cell's contents, code dependent on the cell | 9191 // a change of the type of the cell's contents, code dependent on the cell |
9192 // will be deoptimized. | 9192 // will be deoptimized. |
9193 static void SetValueInferType(Handle<PropertyCell> cell, | 9193 static void SetValueInferType(Handle<PropertyCell> cell, |
9194 Handle<Object> value, | 9194 Handle<Object> value); |
9195 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 9195 |
9196 MUST_USE_RESULT MaybeObject* SetValueInferType( | 9196 // Computes the new type of the cell's contents for the given value, but |
9197 Object* value, | 9197 // without actually modifying the 'type' field. |
9198 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 9198 // TODO(mstarzinger): Return value should be handlified. |
9199 static Type* UpdateType(Handle<PropertyCell> cell, | |
rossberg
2013/10/21 12:16:35
Maybe it would be clearer to call this UpdatedType
Michael Starzinger
2013/10/21 12:49:44
Done.
| |
9200 Handle<Object> value); | |
9201 | |
9202 void AddDependentCompilationInfo(CompilationInfo* info); | |
9203 | |
9204 void AddDependentCode(Handle<Code> code); | |
9199 | 9205 |
9200 // Casting. | 9206 // Casting. |
9201 static inline PropertyCell* cast(Object* obj); | 9207 static inline PropertyCell* cast(Object* obj); |
9202 | 9208 |
9203 inline Address TypeAddress() { | 9209 inline Address TypeAddress() { |
9204 return address() + kTypeOffset; | 9210 return address() + kTypeOffset; |
9205 } | 9211 } |
9206 | 9212 |
9207 // Dispatched behavior. | 9213 // Dispatched behavior. |
9208 DECLARE_PRINTER(PropertyCell) | 9214 DECLARE_PRINTER(PropertyCell) |
9209 DECLARE_VERIFIER(PropertyCell) | 9215 DECLARE_VERIFIER(PropertyCell) |
9210 | 9216 |
9211 // Layout description. | 9217 // Layout description. |
9212 static const int kTypeOffset = kValueOffset + kPointerSize; | 9218 static const int kTypeOffset = kValueOffset + kPointerSize; |
9213 static const int kDependentCodeOffset = kTypeOffset + kPointerSize; | 9219 static const int kDependentCodeOffset = kTypeOffset + kPointerSize; |
9214 static const int kSize = kDependentCodeOffset + kPointerSize; | 9220 static const int kSize = kDependentCodeOffset + kPointerSize; |
9215 | 9221 |
9216 static const int kPointerFieldsBeginOffset = kValueOffset; | 9222 static const int kPointerFieldsBeginOffset = kValueOffset; |
9217 static const int kPointerFieldsEndOffset = kDependentCodeOffset; | 9223 static const int kPointerFieldsEndOffset = kDependentCodeOffset; |
9218 | 9224 |
9219 typedef FixedBodyDescriptor<kValueOffset, | 9225 typedef FixedBodyDescriptor<kValueOffset, |
9220 kSize, | 9226 kSize, |
9221 kSize> BodyDescriptor; | 9227 kSize> BodyDescriptor; |
9222 | 9228 |
9223 void AddDependentCompilationInfo(CompilationInfo* info); | |
9224 | |
9225 void AddDependentCode(Handle<Code> code); | |
9226 | |
9227 static Type* UpdateType(Handle<PropertyCell> cell, | |
9228 Handle<Object> value); | |
9229 | |
9230 private: | 9229 private: |
9231 DECL_ACCESSORS(type_raw, Object) | 9230 DECL_ACCESSORS(type_raw, Object) |
9232 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); | 9231 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); |
9233 }; | 9232 }; |
9234 | 9233 |
9235 | 9234 |
9236 // The JSProxy describes EcmaScript Harmony proxies | 9235 // The JSProxy describes EcmaScript Harmony proxies |
9237 class JSProxy: public JSReceiver { | 9236 class JSProxy: public JSReceiver { |
9238 public: | 9237 public: |
9239 // [handler]: The handler property. | 9238 // [handler]: The handler property. |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10418 } else { | 10417 } else { |
10419 value &= ~(1 << bit_position); | 10418 value &= ~(1 << bit_position); |
10420 } | 10419 } |
10421 return value; | 10420 return value; |
10422 } | 10421 } |
10423 }; | 10422 }; |
10424 | 10423 |
10425 } } // namespace v8::internal | 10424 } } // namespace v8::internal |
10426 | 10425 |
10427 #endif // V8_OBJECTS_H_ | 10426 #endif // V8_OBJECTS_H_ |
OLD | NEW |