OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 // position, whether or not the function is a function expression, | 2658 // position, whether or not the function is a function expression, |
2659 // and whether or not the function is a toplevel function. The two | 2659 // and whether or not the function is a toplevel function. The two |
2660 // least significants bit indicates whether the function is an | 2660 // least significants bit indicates whether the function is an |
2661 // expression and the rest contains the source code position. | 2661 // expression and the rest contains the source code position. |
2662 inline int start_position_and_type(); | 2662 inline int start_position_and_type(); |
2663 inline void set_start_position_and_type(int value); | 2663 inline void set_start_position_and_type(int value); |
2664 | 2664 |
2665 // [debug info]: Debug information. | 2665 // [debug info]: Debug information. |
2666 DECL_ACCESSORS(debug_info, Object) | 2666 DECL_ACCESSORS(debug_info, Object) |
2667 | 2667 |
| 2668 // [inferred name]: Name inferred from variable or property |
| 2669 // assignment of this function. Used to facilitate debugging and |
| 2670 // profiling of JavaScript code written in OO style, where almost |
| 2671 // all functions are anonymous but are assigned to object |
| 2672 // properties. |
| 2673 DECL_ACCESSORS(inferred_name, String) |
| 2674 |
2668 // Position of the 'function' token in the script source. | 2675 // Position of the 'function' token in the script source. |
2669 inline int function_token_position(); | 2676 inline int function_token_position(); |
2670 inline void set_function_token_position(int function_token_position); | 2677 inline void set_function_token_position(int function_token_position); |
2671 | 2678 |
2672 // Position of this function in the script source. | 2679 // Position of this function in the script source. |
2673 inline int start_position(); | 2680 inline int start_position(); |
2674 inline void set_start_position(int start_position); | 2681 inline void set_start_position(int start_position); |
2675 | 2682 |
2676 // End position of this function in the script source. | 2683 // End position of this function in the script source. |
2677 inline int end_position(); | 2684 inline int end_position(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 kExpectedNofPropertiesOffset + kIntSize; | 2724 kExpectedNofPropertiesOffset + kIntSize; |
2718 static const int kExternalReferenceDataOffset = | 2725 static const int kExternalReferenceDataOffset = |
2719 kInstanceClassNameOffset + kPointerSize; | 2726 kInstanceClassNameOffset + kPointerSize; |
2720 static const int kLazyLoadDataOffset = | 2727 static const int kLazyLoadDataOffset = |
2721 kExternalReferenceDataOffset + kPointerSize; | 2728 kExternalReferenceDataOffset + kPointerSize; |
2722 static const int kScriptOffset = kLazyLoadDataOffset + kPointerSize; | 2729 static const int kScriptOffset = kLazyLoadDataOffset + kPointerSize; |
2723 static const int kStartPositionAndTypeOffset = kScriptOffset + kPointerSize; | 2730 static const int kStartPositionAndTypeOffset = kScriptOffset + kPointerSize; |
2724 static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; | 2731 static const int kEndPositionOffset = kStartPositionAndTypeOffset + kIntSize; |
2725 static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize; | 2732 static const int kFunctionTokenPositionOffset = kEndPositionOffset + kIntSize; |
2726 static const int kDebugInfoOffset = kFunctionTokenPositionOffset + kIntSize; | 2733 static const int kDebugInfoOffset = kFunctionTokenPositionOffset + kIntSize; |
2727 static const int kSize = kDebugInfoOffset + kPointerSize; | 2734 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; |
| 2735 static const int kSize = kInferredNameOffset + kPointerSize; |
2728 | 2736 |
2729 private: | 2737 private: |
2730 // Bit positions in length_and_flg. | 2738 // Bit positions in length_and_flg. |
2731 // The least significant bit is used as the flag. | 2739 // The least significant bit is used as the flag. |
2732 static const int kFlagBit = 0; | 2740 static const int kFlagBit = 0; |
2733 static const int kLengthShift = 1; | 2741 static const int kLengthShift = 1; |
2734 static const int kLengthMask = ~((1 << kLengthShift) - 1); | 2742 static const int kLengthMask = ~((1 << kLengthShift) - 1); |
2735 | 2743 |
2736 // Bit positions in start_position_and_type. | 2744 // Bit positions in start_position_and_type. |
2737 // The source code start position is in the 30 most significant bits of | 2745 // The source code start position is in the 30 most significant bits of |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4307 } else { | 4315 } else { |
4308 value &= ~(1 << bit_position); | 4316 value &= ~(1 << bit_position); |
4309 } | 4317 } |
4310 return value; | 4318 return value; |
4311 } | 4319 } |
4312 }; | 4320 }; |
4313 | 4321 |
4314 } } // namespace v8::internal | 4322 } } // namespace v8::internal |
4315 | 4323 |
4316 #endif // V8_OBJECTS_H_ | 4324 #endif // V8_OBJECTS_H_ |
OLD | NEW |