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

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

Issue 7621006: Merge r8520 and 8717 into 3.2 branch, fixing a SplitConstantsInFullCompiler cctest. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.2/
Patch Set: Created 9 years, 4 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 | « src/version.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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 if (f->code()->kind() == Code::FUNCTION) { 369 if (f->code()->kind() == Code::FUNCTION) {
370 Address pc = f->code()->instruction_start(); 370 Address pc = f->code()->instruction_start();
371 int decode_size = 371 int decode_size =
372 Min(f->code()->instruction_size(), 372 Min(f->code()->instruction_size(),
373 static_cast<int>(f->code()->stack_check_table_offset())); 373 static_cast<int>(f->code()->stack_check_table_offset()));
374 Address end = pc + decode_size; 374 Address end = pc + decode_size;
375 375
376 v8::internal::EmbeddedVector<char, 128> decode_buffer; 376 v8::internal::EmbeddedVector<char, 128> decode_buffer;
377 while (pc < end) { 377 while (pc < end) {
378 pc += d.InstructionDecode(decode_buffer, pc); 378 int num_const = d.ConstantPoolSizeAt(pc);
379 CHECK(strstr(decode_buffer.start(), "mov eax,0x178c29c") == NULL); 379 if (num_const >= 0) {
380 CHECK(strstr(decode_buffer.start(), "push 0x178c29c") == NULL); 380 pc += (num_const + 1) * kPointerSize;
381 CHECK(strstr(decode_buffer.start(), "0x178c29c") == NULL); 381 } else {
382 pc += d.InstructionDecode(decode_buffer, pc);
383 CHECK(strstr(decode_buffer.start(), "mov eax,0x178c29c") == NULL);
384 CHECK(strstr(decode_buffer.start(), "push 0x178c29c") == NULL);
385 CHECK(strstr(decode_buffer.start(), "0x178c29c") == NULL);
386 }
382 } 387 }
383 } 388 }
384 } 389 }
385 390
386 391
387 TEST(SplitConstantsInFullCompiler) { 392 TEST(SplitConstantsInFullCompiler) {
388 v8::HandleScope scope; 393 v8::HandleScope scope;
389 LocalContext env; 394 LocalContext env;
390 395
391 CompileRun("function f() { a = 12345678 }; f();"); 396 CompileRun("function f() { a = 12345678 }; f();");
392 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 397 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
393 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 398 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
394 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 399 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
395 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 400 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
396 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 401 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
397 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 402 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
398 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f")); 403 CheckCodeForUnsafeLiteral(GetJSFunction(env->Global(), "f"));
399 } 404 }
400 #endif 405 #endif
OLDNEW
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698