36 using namespace v8::internal;
56 CHECK_EQ(-2, static_cast<int8_t>(-8) >> 2);
57 CHECK_EQ(-2, static_cast<int>(static_cast<intptr_t>(-8) >> 2));
64 const char* s =
"the quick lazy .... oh forget it!";
66 for (
int i = 1; i < length * 2; i++) {
67 static const char kMarker =
static_cast<char>(42);
72 CHECK(n == length || n == -1);
88 int destination_alignment,
89 int length_alignment) {
91 byte* to = dst.
start() + 32 + destination_alignment;
92 byte* from = src.
start() + source_alignment;
95 printf(
"[%d,%d,%d]\n",
96 source_alignment, destination_alignment, length_alignment);
97 for (
int i = 0; i < length; i++) {
113 for (
int i = 0; i <
N; i++) {
114 buffer1[i] =
static_cast<byte>(i & 0x7F);
118 for (
int i = 0; i < 32; i++) {
123 for (
int i = 0; i < 32; i++) {
124 for (
int j = 1; j < 32; j++) {
125 TestMemCopy(buffer1, buffer2, i, (i + j) & 0x1F , 0);
130 for (
int i = 0; i < 32; i++) {
141 const int kLoops = 5;
142 const int kSequentialSize = 1000;
143 const int kBlockSize = 7;
144 for (
int loop = 0; loop < kLoops; loop++) {
146 for (
int i = 0; i < kSequentialSize; i++) {
149 for (
int i = 0; i < kBlockSize - 1; i++) {
154 CHECK_EQ(kLoops * (kBlockSize + kSequentialSize), result.
length());
155 for (
int i = 0; i < kLoops; i++) {
156 int offset = i * (kSequentialSize + kBlockSize);
157 for (
int j = 0; j < kBlockSize - 1; j++) {
158 CHECK_EQ(j * 7, result[offset + j]);
160 CHECK_EQ(0xbadcafe, result[offset + kBlockSize - 1]);
161 for (
int j = 0; j < kSequentialSize; j++) {
162 CHECK_EQ(j, result[offset + kBlockSize + j]);
171 const int kLoops = 5000;
172 const int kMaxSequenceSize = 13;
173 int total_length = 0;
174 for (
int loop = 0; loop < kLoops; loop++) {
175 int seq_length = loop % kMaxSequenceSize;
177 for (
int j = 0; j < seq_length; j++) {
181 for (
int j = 0; j < seq_length; j++) {
184 total_length += seq_length;
189 for (
int loop = 0; loop < kLoops; loop++) {
190 int seq_length = loop % kMaxSequenceSize;
191 for (
int j = 0; j < seq_length; j++) {
200 TEST(SequenceCollectorRegression) {
207 CHECK_EQ(0, strncmp(
"0123456789012345678901234567890123",
#define CHECK_EQ(expected, value)
void TestMemCopy(Vector< byte > src, Vector< byte > dst, int source_alignment, int destination_alignment, int length_alignment)
static const int kMinComplexMemCopy
Vector< T > AddBlock(int size, T initial_value)
static void MemCopy(void *dest, const void *src, size_t size)
static Vector< T > New(int length)
int StrLength(const char *string)
static int SNPrintF(Vector< char > str, const char *format,...)
Vector< T > EndSequence()