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 7984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7995 | 7995 |
7996 // Representation of message objects used for error reporting through | 7996 // Representation of message objects used for error reporting through |
7997 // the API. The messages are formatted in JavaScript so this object is | 7997 // the API. The messages are formatted in JavaScript so this object is |
7998 // a real JavaScript object. The information used for formatting the | 7998 // a real JavaScript object. The information used for formatting the |
7999 // error messages are not directly accessible from JavaScript to | 7999 // error messages are not directly accessible from JavaScript to |
8000 // prevent leaking information to user code called during error | 8000 // prevent leaking information to user code called during error |
8001 // formatting. | 8001 // formatting. |
8002 class JSMessageObject: public JSObject { | 8002 class JSMessageObject: public JSObject { |
8003 public: | 8003 public: |
8004 // [type]: the type of error message. | 8004 // [type]: the type of error message. |
8005 DECL_ACCESSORS(type, String) | 8005 inline int type() const; |
| 8006 inline void set_type(int value); |
8006 | 8007 |
8007 // [arguments]: the arguments for formatting the error message. | 8008 // [arguments]: the arguments for formatting the error message. |
8008 DECL_ACCESSORS(arguments, JSArray) | 8009 DECL_ACCESSORS(argument, Object) |
8009 | 8010 |
8010 // [script]: the script from which the error message originated. | 8011 // [script]: the script from which the error message originated. |
8011 DECL_ACCESSORS(script, Object) | 8012 DECL_ACCESSORS(script, Object) |
8012 | 8013 |
8013 // [stack_frames]: an array of stack frames for this error object. | 8014 // [stack_frames]: an array of stack frames for this error object. |
8014 DECL_ACCESSORS(stack_frames, Object) | 8015 DECL_ACCESSORS(stack_frames, Object) |
8015 | 8016 |
8016 // [start_position]: the start position in the script for the error message. | 8017 // [start_position]: the start position in the script for the error message. |
8017 inline int start_position() const; | 8018 inline int start_position() const; |
8018 inline void set_start_position(int value); | 8019 inline void set_start_position(int value); |
(...skipping 2522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10541 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10542 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
10542 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; | 10543 static const int kSize = kExpectedReceiverTypeOffset + kPointerSize; |
10543 | 10544 |
10544 private: | 10545 private: |
10545 inline bool HasExpectedReceiverType() { | 10546 inline bool HasExpectedReceiverType() { |
10546 return expected_receiver_type()->IsFunctionTemplateInfo(); | 10547 return expected_receiver_type()->IsFunctionTemplateInfo(); |
10547 } | 10548 } |
10548 // Bit positions in flag. | 10549 // Bit positions in flag. |
10549 static const int kAllCanReadBit = 0; | 10550 static const int kAllCanReadBit = 0; |
10550 static const int kAllCanWriteBit = 1; | 10551 static const int kAllCanWriteBit = 1; |
10551 class AttributesField: public BitField<PropertyAttributes, 2, 3> {}; | 10552 class AttributesField : public BitField<PropertyAttributes, 2, 3> {}; |
10552 | 10553 |
10553 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); | 10554 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); |
10554 }; | 10555 }; |
10555 | 10556 |
10556 | 10557 |
10557 // An accessor must have a getter, but can have no setter. | 10558 // An accessor must have a getter, but can have no setter. |
10558 // | 10559 // |
10559 // When setting a property, V8 searches accessors in prototypes. | 10560 // When setting a property, V8 searches accessors in prototypes. |
10560 // If an accessor was found and it does not have a setter, | 10561 // If an accessor was found and it does not have a setter, |
10561 // the request is ignored. | 10562 // the request is ignored. |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11111 } else { | 11112 } else { |
11112 value &= ~(1 << bit_position); | 11113 value &= ~(1 << bit_position); |
11113 } | 11114 } |
11114 return value; | 11115 return value; |
11115 } | 11116 } |
11116 }; | 11117 }; |
11117 | 11118 |
11118 } } // namespace v8::internal | 11119 } } // namespace v8::internal |
11119 | 11120 |
11120 #endif // V8_OBJECTS_H_ | 11121 #endif // V8_OBJECTS_H_ |
OLD | NEW |