OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 // each byte to indicate whether or not more bytes follow. | 1176 // each byte to indicate whether or not more bytes follow. |
1177 do { | 1177 do { |
1178 uint32_t next = bits >> 7; | 1178 uint32_t next = bits >> 7; |
1179 contents_.Add(((bits << 1) & 0xFF) | (next != 0)); | 1179 contents_.Add(((bits << 1) & 0xFF) | (next != 0)); |
1180 bits = next; | 1180 bits = next; |
1181 } while (bits != 0); | 1181 } while (bits != 0); |
1182 } | 1182 } |
1183 | 1183 |
1184 | 1184 |
1185 int32_t TranslationIterator::Next() { | 1185 int32_t TranslationIterator::Next() { |
1186 ASSERT(HasNext()); | |
1187 // Run through the bytes until we reach one with a least significant | 1186 // Run through the bytes until we reach one with a least significant |
1188 // bit of zero (marks the end). | 1187 // bit of zero (marks the end). |
1189 uint32_t bits = 0; | 1188 uint32_t bits = 0; |
1190 for (int i = 0; true; i += 7) { | 1189 for (int i = 0; true; i += 7) { |
| 1190 ASSERT(HasNext()); |
1191 uint8_t next = buffer_->get(index_++); | 1191 uint8_t next = buffer_->get(index_++); |
1192 bits |= (next >> 1) << i; | 1192 bits |= (next >> 1) << i; |
1193 if ((next & 1) == 0) break; | 1193 if ((next & 1) == 0) break; |
1194 } | 1194 } |
1195 // The bits encode the sign in the least significant bit. | 1195 // The bits encode the sign in the least significant bit. |
1196 bool is_negative = (bits & 1) == 1; | 1196 bool is_negative = (bits & 1) == 1; |
1197 int32_t result = bits >> 1; | 1197 int32_t result = bits >> 1; |
1198 return is_negative ? -result : result; | 1198 return is_negative ? -result : result; |
1199 } | 1199 } |
1200 | 1200 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 | 1464 |
1465 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 1465 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
1466 v->VisitPointer(BitCast<Object**>(&function_)); | 1466 v->VisitPointer(BitCast<Object**>(&function_)); |
1467 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 1467 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
1468 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 1468 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
1469 } | 1469 } |
1470 | 1470 |
1471 #endif // ENABLE_DEBUGGER_SUPPORT | 1471 #endif // ENABLE_DEBUGGER_SUPPORT |
1472 | 1472 |
1473 } } // namespace v8::internal | 1473 } } // namespace v8::internal |
OLD | NEW |