| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 for (int i = 0; i < length; i++) { | 96 for (int i = 0; i < length; i++) { |
| 97 CHECK_EQ(from[i], to[i]); | 97 CHECK_EQ(from[i], to[i]); |
| 98 } | 98 } |
| 99 CHECK_EQ(0xFF, to[-1]); | 99 CHECK_EQ(0xFF, to[-1]); |
| 100 CHECK_EQ(0xFF, to[length]); | 100 CHECK_EQ(0xFF, to[length]); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 | 104 |
| 105 TEST(MemCopy) { | 105 TEST(MemCopy) { |
| 106 V8::Initialize(NULL); | 106 OS::Setup(); |
| 107 const int N = kMinComplexMemCopy + 128; | 107 const int N = kMinComplexMemCopy + 128; |
| 108 Vector<byte> buffer1 = Vector<byte>::New(N); | 108 Vector<byte> buffer1 = Vector<byte>::New(N); |
| 109 Vector<byte> buffer2 = Vector<byte>::New(N); | 109 Vector<byte> buffer2 = Vector<byte>::New(N); |
| 110 | 110 |
| 111 for (int i = 0; i < N; i++) { | 111 for (int i = 0; i < N; i++) { |
| 112 buffer1[i] = static_cast<byte>(i & 0x7F); | 112 buffer1[i] = static_cast<byte>(i & 0x7F); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Same alignment. | 115 // Same alignment. |
| 116 for (int i = 0; i < 32; i++) { | 116 for (int i = 0; i < 32; i++) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 int offset = 0; | 186 int offset = 0; |
| 187 for (int loop = 0; loop < kLoops; loop++) { | 187 for (int loop = 0; loop < kLoops; loop++) { |
| 188 int seq_length = loop % kMaxSequenceSize; | 188 int seq_length = loop % kMaxSequenceSize; |
| 189 for (int j = 0; j < seq_length; j++) { | 189 for (int j = 0; j < seq_length; j++) { |
| 190 CHECK_EQ(j, result[offset]); | 190 CHECK_EQ(j, result[offset]); |
| 191 offset++; | 191 offset++; |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 result.Dispose(); | 194 result.Dispose(); |
| 195 } | 195 } |
| OLD | NEW |