| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 return state_.current_statement_position; | 1078 return state_.current_statement_position; |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 private: | 1081 private: |
| 1082 Assembler* assembler_; | 1082 Assembler* assembler_; |
| 1083 PositionState state_; | 1083 PositionState state_; |
| 1084 | 1084 |
| 1085 // Currently jit_handler_data_ is used to store JITHandler-specific data | 1085 // Currently jit_handler_data_ is used to store JITHandler-specific data |
| 1086 // over the lifetime of a PositionsRecorder | 1086 // over the lifetime of a PositionsRecorder |
| 1087 void* jit_handler_data_; | 1087 void* jit_handler_data_; |
| 1088 friend class PreservePositionScope; | |
| 1089 | 1088 |
| 1090 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 1089 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
| 1091 }; | 1090 }; |
| 1092 | 1091 |
| 1093 | 1092 |
| 1094 class PreservePositionScope BASE_EMBEDDED { | |
| 1095 public: | |
| 1096 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | |
| 1097 : positions_recorder_(positions_recorder), | |
| 1098 saved_state_(positions_recorder->state_) { | |
| 1099 // Reset positions so that previous ones do not accidentally get | |
| 1100 // recorded within this scope. | |
| 1101 positions_recorder->state_ = PositionState(); | |
| 1102 } | |
| 1103 | |
| 1104 ~PreservePositionScope() { | |
| 1105 positions_recorder_->state_ = saved_state_; | |
| 1106 } | |
| 1107 | |
| 1108 private: | |
| 1109 PositionsRecorder* positions_recorder_; | |
| 1110 const PositionState saved_state_; | |
| 1111 | |
| 1112 DISALLOW_COPY_AND_ASSIGN(PreservePositionScope); | |
| 1113 }; | |
| 1114 | |
| 1115 | |
| 1116 // ----------------------------------------------------------------------------- | 1093 // ----------------------------------------------------------------------------- |
| 1117 // Utility functions | 1094 // Utility functions |
| 1118 | 1095 |
| 1119 inline int NumberOfBitsSet(uint32_t x) { | 1096 inline int NumberOfBitsSet(uint32_t x) { |
| 1120 unsigned int num_bits_set; | 1097 unsigned int num_bits_set; |
| 1121 for (num_bits_set = 0; x; x >>= 1) { | 1098 for (num_bits_set = 0; x; x >>= 1) { |
| 1122 num_bits_set += x & 1; | 1099 num_bits_set += x & 1; |
| 1123 } | 1100 } |
| 1124 return num_bits_set; | 1101 return num_bits_set; |
| 1125 } | 1102 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 }; | 1247 }; |
| 1271 | 1248 |
| 1272 Label emitted_label_; // Records pc_offset of emitted pool | 1249 Label emitted_label_; // Records pc_offset of emitted pool |
| 1273 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1250 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
| 1274 }; | 1251 }; |
| 1275 | 1252 |
| 1276 | 1253 |
| 1277 } } // namespace v8::internal | 1254 } } // namespace v8::internal |
| 1278 | 1255 |
| 1279 #endif // V8_ASSEMBLER_H_ | 1256 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |