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

Side by Side Diff: test/cctest/compiler/test-run-intrinsics.cc

Issue 1370153002: [heap] Cleanup string factory methods a bit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-macro-2
Patch Set: Remove dead test. Created 5 years, 2 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
« no previous file with comments | « src/runtime/runtime-strings.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "test/cctest/compiler/function-tester.h" 7 #include "test/cctest/compiler/function-tester.h"
8 8
9 using namespace v8::internal; 9 using namespace v8::internal;
10 using namespace v8::internal::compiler; 10 using namespace v8::internal::compiler;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 string->SeqOneByteStringSet(0, 'b'); 210 string->SeqOneByteStringSet(0, 'b');
211 string->SeqOneByteStringSet(1, 'a'); 211 string->SeqOneByteStringSet(1, 'a');
212 string->SeqOneByteStringSet(2, 'r'); 212 string->SeqOneByteStringSet(2, 'r');
213 T.Call(T.Val(1), string); 213 T.Call(T.Val(1), string);
214 CHECK_EQ('b', string->SeqOneByteStringGet(0)); 214 CHECK_EQ('b', string->SeqOneByteStringGet(0));
215 CHECK_EQ('X', string->SeqOneByteStringGet(1)); 215 CHECK_EQ('X', string->SeqOneByteStringGet(1));
216 CHECK_EQ('r', string->SeqOneByteStringGet(2)); 216 CHECK_EQ('r', string->SeqOneByteStringGet(2));
217 } 217 }
218 218
219 219
220 TEST(NewConsString) {
221 FunctionTester T(
222 "(function() { "
223 " return %_NewConsString(14, true, 'abcdefghi', 'jklmn');"
224 " })",
225 flags);
226
227 T.CheckCall(T.Val("abcdefghijklmn"));
228 }
229
230
231 TEST(SetValueOf) { 220 TEST(SetValueOf) {
232 FunctionTester T("(function(a,b) { return %_SetValueOf(a,b); })", flags); 221 FunctionTester T("(function(a,b) { return %_SetValueOf(a,b); })", flags);
233 222
234 T.CheckCall(T.Val("a"), T.NewObject("(new String)"), T.Val("a")); 223 T.CheckCall(T.Val("a"), T.NewObject("(new String)"), T.Val("a"));
235 T.CheckCall(T.Val(123), T.NewObject("(new Number)"), T.Val(123)); 224 T.CheckCall(T.Val(123), T.NewObject("(new Number)"), T.Val(123));
236 T.CheckCall(T.Val("x"), T.undefined(), T.Val("x")); 225 T.CheckCall(T.Val("x"), T.undefined(), T.Val("x"));
237 } 226 }
238 227
239 228
240 TEST(StringAdd) { 229 TEST(StringAdd) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 313
325 314
326 TEST(ValueOf) { 315 TEST(ValueOf) {
327 FunctionTester T("(function(a) { return %_ValueOf(a); })", flags); 316 FunctionTester T("(function(a) { return %_ValueOf(a); })", flags);
328 317
329 T.CheckCall(T.Val("a"), T.Val("a")); 318 T.CheckCall(T.Val("a"), T.Val("a"));
330 T.CheckCall(T.Val("b"), T.NewObject("(new String('b'))")); 319 T.CheckCall(T.Val("b"), T.NewObject("(new String('b'))"));
331 T.CheckCall(T.Val(123), T.Val(123)); 320 T.CheckCall(T.Val(123), T.Val(123));
332 T.CheckCall(T.Val(456), T.NewObject("(new Number(456))")); 321 T.CheckCall(T.Val(456), T.NewObject("(new Number(456))"));
333 } 322 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-strings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698