| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Read only (non-statement) positions. | 59 // Read only (non-statement) positions. |
| 60 { | 60 { |
| 61 RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::POSITION)); | 61 RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::POSITION)); |
| 62 pc = *buf; | 62 pc = *buf; |
| 63 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { | 63 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { |
| 64 RelocInfo::Mode mode = (i % 2 == 0) ? | 64 RelocInfo::Mode mode = (i % 2 == 0) ? |
| 65 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; | 65 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; |
| 66 if (mode == RelocInfo::POSITION) { | 66 if (mode == RelocInfo::POSITION) { |
| 67 CHECK_EQ(pc, it.rinfo()->pc()); | 67 CHECK_EQ(pc, it.rinfo()->pc()); |
| 68 CHECK_EQ(mode, it.rinfo()->rmode()); | 68 CHECK_EQ(mode, it.rinfo()->rmode()); |
| 69 CHECK_EQ(static_cast<intptr_t>(pos), it.rinfo()->data()); | 69 CHECK_EQ(pos, static_cast<int>(it.rinfo()->data())); |
| 70 it.next(); | 70 it.next(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 CHECK(it.done()); | 73 CHECK(it.done()); |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Read only statement positions. | 76 // Read only statement positions. |
| 77 { | 77 { |
| 78 RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION)); | 78 RelocIterator it(desc, RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION)); |
| 79 pc = *buf; | 79 pc = *buf; |
| 80 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { | 80 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { |
| 81 RelocInfo::Mode mode = (i % 2 == 0) ? | 81 RelocInfo::Mode mode = (i % 2 == 0) ? |
| 82 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; | 82 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; |
| 83 if (mode == RelocInfo::STATEMENT_POSITION) { | 83 if (mode == RelocInfo::STATEMENT_POSITION) { |
| 84 CHECK_EQ(pc, it.rinfo()->pc()); | 84 CHECK_EQ(pc, it.rinfo()->pc()); |
| 85 CHECK_EQ(mode, it.rinfo()->rmode()); | 85 CHECK_EQ(mode, it.rinfo()->rmode()); |
| 86 CHECK_EQ(static_cast<intptr_t>(pos), it.rinfo()->data()); | 86 CHECK_EQ(pos, static_cast<int>(it.rinfo()->data())); |
| 87 it.next(); | 87 it.next(); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 CHECK(it.done()); | 90 CHECK(it.done()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Read both types of positions. | 93 // Read both types of positions. |
| 94 { | 94 { |
| 95 RelocIterator it(desc, RelocInfo::kPositionMask); | 95 RelocIterator it(desc, RelocInfo::kPositionMask); |
| 96 pc = *buf; | 96 pc = *buf; |
| 97 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { | 97 for (int i = 0, pos = 0; i < 100; i++, pc += i, pos += i) { |
| 98 RelocInfo::Mode mode = (i % 2 == 0) ? | 98 RelocInfo::Mode mode = (i % 2 == 0) ? |
| 99 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; | 99 RelocInfo::STATEMENT_POSITION : RelocInfo::POSITION; |
| 100 CHECK_EQ(pc, it.rinfo()->pc()); | 100 CHECK_EQ(pc, it.rinfo()->pc()); |
| 101 CHECK_EQ(mode, it.rinfo()->rmode()); | 101 CHECK_EQ(mode, it.rinfo()->rmode()); |
| 102 CHECK_EQ(static_cast<intptr_t>(pos), it.rinfo()->data()); | 102 CHECK_EQ(pos, static_cast<int>(it.rinfo()->data())); |
| 103 it.next(); | 103 it.next(); |
| 104 } | 104 } |
| 105 CHECK(it.done()); | 105 CHECK(it.done()); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 } } // namespace v8::internal | 109 } } // namespace v8::internal |
| OLD | NEW |