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 7373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7384 | 7384 |
7385 // This is like GetProperty, but is used when you know the lookup won't fail | 7385 // This is like GetProperty, but is used when you know the lookup won't fail |
7386 // by throwing an exception. This is for the debug and builtins global | 7386 // by throwing an exception. This is for the debug and builtins global |
7387 // objects, where it is known which properties can be expected to be present | 7387 // objects, where it is known which properties can be expected to be present |
7388 // on the object. | 7388 // on the object. |
7389 Object* GetPropertyNoExceptionThrown(Name* key) { | 7389 Object* GetPropertyNoExceptionThrown(Name* key) { |
7390 Object* answer = GetProperty(key)->ToObjectUnchecked(); | 7390 Object* answer = GetProperty(key)->ToObjectUnchecked(); |
7391 return answer; | 7391 return answer; |
7392 } | 7392 } |
7393 | 7393 |
7394 // Ensure that the global object has a cell for the given property name. | |
7395 static Handle<PropertyCell> EnsurePropertyCell(Handle<GlobalObject> global, | |
7396 Handle<Name> name); | |
7397 | |
7398 // Casting. | 7394 // Casting. |
7399 static inline GlobalObject* cast(Object* obj); | 7395 static inline GlobalObject* cast(Object* obj); |
7400 | 7396 |
7401 // Layout description. | 7397 // Layout description. |
7402 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 7398 static const int kBuiltinsOffset = JSObject::kHeaderSize; |
7403 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; | 7399 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; |
7404 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize; | 7400 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize; |
7405 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize; | 7401 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize; |
7406 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize; | 7402 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize; |
7407 | 7403 |
7408 private: | 7404 private: |
7409 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); | 7405 DISALLOW_IMPLICIT_CONSTRUCTORS(GlobalObject); |
7410 }; | 7406 }; |
7411 | 7407 |
7412 | 7408 |
7413 // JavaScript global object. | 7409 // JavaScript global object. |
7414 class JSGlobalObject: public GlobalObject { | 7410 class JSGlobalObject: public GlobalObject { |
7415 public: | 7411 public: |
7416 // Casting. | 7412 // Casting. |
7417 static inline JSGlobalObject* cast(Object* obj); | 7413 static inline JSGlobalObject* cast(Object* obj); |
7418 | 7414 |
| 7415 // Ensure that the global object has a cell for the given property name. |
| 7416 static Handle<PropertyCell> EnsurePropertyCell(Handle<JSGlobalObject> global, |
| 7417 Handle<Name> name); |
| 7418 |
7419 // Dispatched behavior. | 7419 // Dispatched behavior. |
7420 DECLARE_PRINTER(JSGlobalObject) | 7420 DECLARE_PRINTER(JSGlobalObject) |
7421 DECLARE_VERIFIER(JSGlobalObject) | 7421 DECLARE_VERIFIER(JSGlobalObject) |
7422 | 7422 |
7423 // Layout description. | 7423 // Layout description. |
7424 static const int kSize = GlobalObject::kHeaderSize; | 7424 static const int kSize = GlobalObject::kHeaderSize; |
7425 | 7425 |
7426 private: | 7426 private: |
7427 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); | 7427 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGlobalObject); |
7428 }; | 7428 }; |
(...skipping 3013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10442 } else { | 10442 } else { |
10443 value &= ~(1 << bit_position); | 10443 value &= ~(1 << bit_position); |
10444 } | 10444 } |
10445 return value; | 10445 return value; |
10446 } | 10446 } |
10447 }; | 10447 }; |
10448 | 10448 |
10449 } } // namespace v8::internal | 10449 } } // namespace v8::internal |
10450 | 10450 |
10451 #endif // V8_OBJECTS_H_ | 10451 #endif // V8_OBJECTS_H_ |
OLD | NEW |