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));
80 const char* s =
"the quick lazy .... oh forget it!";
82 for (
int i = 1; i < length * 2; i++) {
83 static const char kMarker =
static_cast<char>(42);
88 CHECK(n == length || n == -1);
103 int source_alignment,
104 int destination_alignment,
105 int length_alignment) {
107 byte* to = dst.
start() + 32 + destination_alignment;
108 byte* from = src.
start() + source_alignment;
110 OS::MemCopy(to, from, static_cast<size_t>(length));
111 printf(
"[%d,%d,%d]\n",
112 source_alignment, destination_alignment, length_alignment);
113 for (
int i = 0; i < length; i++) {
129 for (
int i = 0; i <
N; i++) {
130 buffer1[i] =
static_cast<byte>(i & 0x7F);
134 for (
int i = 0; i < 32; i++) {
139 for (
int i = 0; i < 32; i++) {
140 for (
int j = 1; j < 32; j++) {
141 TestMemCopy(buffer1, buffer2, i, (i + j) & 0x1F , 0);
146 for (
int i = 0; i < 32; i++) {
157 const int kLoops = 5;
158 const int kSequentialSize = 1000;
159 const int kBlockSize = 7;
160 for (
int loop = 0; loop < kLoops; loop++) {
162 for (
int i = 0; i < kSequentialSize; i++) {
165 for (
int i = 0; i < kBlockSize - 1; i++) {
170 CHECK_EQ(kLoops * (kBlockSize + kSequentialSize), result.
length());
171 for (
int i = 0; i < kLoops; i++) {
172 int offset = i * (kSequentialSize + kBlockSize);
173 for (
int j = 0; j < kBlockSize - 1; j++) {
174 CHECK_EQ(j * 7, result[offset + j]);
176 CHECK_EQ(0xbadcafe, result[offset + kBlockSize - 1]);
177 for (
int j = 0; j < kSequentialSize; j++) {
178 CHECK_EQ(j, result[offset + kBlockSize + j]);
187 const int kLoops = 5000;
188 const int kMaxSequenceSize = 13;
189 int total_length = 0;
190 for (
int loop = 0; loop < kLoops; loop++) {
191 int seq_length = loop % kMaxSequenceSize;
193 for (
int j = 0; j < seq_length; j++) {
197 for (
int j = 0; j < seq_length; j++) {
200 total_length += seq_length;
205 for (
int loop = 0; loop < kLoops; loop++) {
206 int seq_length = loop % kMaxSequenceSize;
207 for (
int j = 0; j < seq_length; j++) {
216 TEST(SequenceCollectorRegression) {
223 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)
int FastD2IChecked(double x)
static Vector< T > New(int length)
int StrLength(const char *string)
static int SNPrintF(Vector< char > str, const char *format,...)
Vector< T > EndSequence()
static double nan_value()