Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: test/cctest/test-utils.cc

Issue 2807031: [Isolates] RegExpStack and memory allocation limits (statics #6) (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: -> is different than . Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 OS::Setup();
106 const int N = kMinComplexMemCopy + 128; 107 const int N = kMinComplexMemCopy + 128;
107 Vector<byte> buffer1 = Vector<byte>::New(N); 108 Vector<byte> buffer1 = Vector<byte>::New(N);
108 Vector<byte> buffer2 = Vector<byte>::New(N); 109 Vector<byte> buffer2 = Vector<byte>::New(N);
109 110
110 for (int i = 0; i < N; i++) { 111 for (int i = 0; i < N; i++) {
111 buffer1[i] = static_cast<byte>(i & 0x7F); 112 buffer1[i] = static_cast<byte>(i & 0x7F);
112 } 113 }
113 114
114 // Same alignment. 115 // Same alignment.
115 for (int i = 0; i < 32; i++) { 116 for (int i = 0; i < 32; i++) {
116 TestMemCopy(buffer1, buffer2, i, i, i * 2); 117 TestMemCopy(buffer1, buffer2, i, i, i * 2);
117 } 118 }
118 119
119 // Different alignment. 120 // Different alignment.
120 for (int i = 0; i < 32; i++) { 121 for (int i = 0; i < 32; i++) {
121 for (int j = 1; j < 32; j++) { 122 for (int j = 1; j < 32; j++) {
122 TestMemCopy(buffer1, buffer2, i, (i + j) & 0x1F , 0); 123 TestMemCopy(buffer1, buffer2, i, (i + j) & 0x1F , 0);
123 } 124 }
124 } 125 }
125 126
126 // Different lengths 127 // Different lengths
127 for (int i = 0; i < 32; i++) { 128 for (int i = 0; i < 32; i++) {
128 TestMemCopy(buffer1, buffer2, 3, 7, i); 129 TestMemCopy(buffer1, buffer2, 3, 7, i);
129 } 130 }
130 131
131 buffer2.Dispose(); 132 buffer2.Dispose();
132 buffer1.Dispose(); 133 buffer1.Dispose();
133 } 134 }
OLDNEW
« no previous file with comments | « test/cctest/test-spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698