| OLD | NEW | 
|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 147 | 147 | 
| 148 // Test that we can move a Smi value literally into a register. | 148 // Test that we can move a Smi value literally into a register. | 
| 149 TEST(SmiMove) { | 149 TEST(SmiMove) { | 
| 150   // Allocate an executable page of memory. | 150   // Allocate an executable page of memory. | 
| 151   size_t actual_size; | 151   size_t actual_size; | 
| 152   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 152   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 153       Assembler::kMinimalBufferSize, &actual_size, true)); | 153       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 154   CHECK(buffer); | 154   CHECK(buffer); | 
| 155   Isolate* isolate = CcTest::i_isolate(); | 155   Isolate* isolate = CcTest::i_isolate(); | 
| 156   HandleScope handles(isolate); | 156   HandleScope handles(isolate); | 
| 157   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 157   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 158                            v8::internal::CodeObjectRequired::kYes); | 
| 158   MacroAssembler* masm = &assembler;  // Create a pointer for the __ macro. | 159   MacroAssembler* masm = &assembler;  // Create a pointer for the __ macro. | 
| 159   EntryCode(masm); | 160   EntryCode(masm); | 
| 160   Label exit; | 161   Label exit; | 
| 161 | 162 | 
| 162   TestMoveSmi(masm, &exit, 1, Smi::FromInt(0)); | 163   TestMoveSmi(masm, &exit, 1, Smi::FromInt(0)); | 
| 163   TestMoveSmi(masm, &exit, 2, Smi::FromInt(127)); | 164   TestMoveSmi(masm, &exit, 2, Smi::FromInt(127)); | 
| 164   TestMoveSmi(masm, &exit, 3, Smi::FromInt(128)); | 165   TestMoveSmi(masm, &exit, 3, Smi::FromInt(128)); | 
| 165   TestMoveSmi(masm, &exit, 4, Smi::FromInt(255)); | 166   TestMoveSmi(masm, &exit, 4, Smi::FromInt(255)); | 
| 166   TestMoveSmi(masm, &exit, 5, Smi::FromInt(256)); | 167   TestMoveSmi(masm, &exit, 5, Smi::FromInt(256)); | 
| 167   TestMoveSmi(masm, &exit, 6, Smi::FromInt(Smi::kMaxValue)); | 168   TestMoveSmi(masm, &exit, 6, Smi::FromInt(Smi::kMaxValue)); | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 232 | 233 | 
| 233 // Test that we can compare smis for equality (and more). | 234 // Test that we can compare smis for equality (and more). | 
| 234 TEST(SmiCompare) { | 235 TEST(SmiCompare) { | 
| 235   // Allocate an executable page of memory. | 236   // Allocate an executable page of memory. | 
| 236   size_t actual_size; | 237   size_t actual_size; | 
| 237   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 238   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 238       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 239       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 239   CHECK(buffer); | 240   CHECK(buffer); | 
| 240   Isolate* isolate = CcTest::i_isolate(); | 241   Isolate* isolate = CcTest::i_isolate(); | 
| 241   HandleScope handles(isolate); | 242   HandleScope handles(isolate); | 
| 242   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 243   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 244                            v8::internal::CodeObjectRequired::kYes); | 
| 243 | 245 | 
| 244   MacroAssembler* masm = &assembler; | 246   MacroAssembler* masm = &assembler; | 
| 245   EntryCode(masm); | 247   EntryCode(masm); | 
| 246   Label exit; | 248   Label exit; | 
| 247 | 249 | 
| 248   TestSmiCompare(masm, &exit, 0x10, 0, 0); | 250   TestSmiCompare(masm, &exit, 0x10, 0, 0); | 
| 249   TestSmiCompare(masm, &exit, 0x20, 0, 1); | 251   TestSmiCompare(masm, &exit, 0x20, 0, 1); | 
| 250   TestSmiCompare(masm, &exit, 0x30, 1, 0); | 252   TestSmiCompare(masm, &exit, 0x30, 1, 0); | 
| 251   TestSmiCompare(masm, &exit, 0x40, 1, 1); | 253   TestSmiCompare(masm, &exit, 0x40, 1, 1); | 
| 252   TestSmiCompare(masm, &exit, 0x50, 0, -1); | 254   TestSmiCompare(masm, &exit, 0x50, 0, -1); | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 280 | 282 | 
| 281 | 283 | 
| 282 TEST(Integer32ToSmi) { | 284 TEST(Integer32ToSmi) { | 
| 283   // Allocate an executable page of memory. | 285   // Allocate an executable page of memory. | 
| 284   size_t actual_size; | 286   size_t actual_size; | 
| 285   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 287   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 286       Assembler::kMinimalBufferSize, &actual_size, true)); | 288       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 287   CHECK(buffer); | 289   CHECK(buffer); | 
| 288   Isolate* isolate = CcTest::i_isolate(); | 290   Isolate* isolate = CcTest::i_isolate(); | 
| 289   HandleScope handles(isolate); | 291   HandleScope handles(isolate); | 
| 290   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 292   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 293                            v8::internal::CodeObjectRequired::kYes); | 
| 291 | 294 | 
| 292   MacroAssembler* masm = &assembler; | 295   MacroAssembler* masm = &assembler; | 
| 293   EntryCode(masm); | 296   EntryCode(masm); | 
| 294   Label exit; | 297   Label exit; | 
| 295 | 298 | 
| 296   __ movq(rax, Immediate(1));  // Test number. | 299   __ movq(rax, Immediate(1));  // Test number. | 
| 297   __ movl(rcx, Immediate(0)); | 300   __ movl(rcx, Immediate(0)); | 
| 298   __ Integer32ToSmi(rcx, rcx); | 301   __ Integer32ToSmi(rcx, rcx); | 
| 299   __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(0))); | 302   __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(0))); | 
| 300   __ cmpq(rcx, rdx); | 303   __ cmpq(rcx, rdx); | 
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 406 | 409 | 
| 407 | 410 | 
| 408 TEST(Integer64PlusConstantToSmi) { | 411 TEST(Integer64PlusConstantToSmi) { | 
| 409   // Allocate an executable page of memory. | 412   // Allocate an executable page of memory. | 
| 410   size_t actual_size; | 413   size_t actual_size; | 
| 411   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 414   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 412       Assembler::kMinimalBufferSize, &actual_size, true)); | 415       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 413   CHECK(buffer); | 416   CHECK(buffer); | 
| 414   Isolate* isolate = CcTest::i_isolate(); | 417   Isolate* isolate = CcTest::i_isolate(); | 
| 415   HandleScope handles(isolate); | 418   HandleScope handles(isolate); | 
| 416   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 419   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 420                            v8::internal::CodeObjectRequired::kYes); | 
| 417 | 421 | 
| 418   MacroAssembler* masm = &assembler; | 422   MacroAssembler* masm = &assembler; | 
| 419   EntryCode(masm); | 423   EntryCode(masm); | 
| 420   Label exit; | 424   Label exit; | 
| 421 | 425 | 
| 422   int64_t twice_max = static_cast<int64_t>(Smi::kMaxValue) * 2; | 426   int64_t twice_max = static_cast<int64_t>(Smi::kMaxValue) * 2; | 
| 423 | 427 | 
| 424   TestI64PlusConstantToSmi(masm, &exit, 0x10, 0, 0); | 428   TestI64PlusConstantToSmi(masm, &exit, 0x10, 0, 0); | 
| 425   TestI64PlusConstantToSmi(masm, &exit, 0x20, 0, 1); | 429   TestI64PlusConstantToSmi(masm, &exit, 0x20, 0, 1); | 
| 426   TestI64PlusConstantToSmi(masm, &exit, 0x30, 1, 0); | 430   TestI64PlusConstantToSmi(masm, &exit, 0x30, 1, 0); | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 448 | 452 | 
| 449 | 453 | 
| 450 TEST(SmiCheck) { | 454 TEST(SmiCheck) { | 
| 451   // Allocate an executable page of memory. | 455   // Allocate an executable page of memory. | 
| 452   size_t actual_size; | 456   size_t actual_size; | 
| 453   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 457   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 454       Assembler::kMinimalBufferSize, &actual_size, true)); | 458       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 455   CHECK(buffer); | 459   CHECK(buffer); | 
| 456   Isolate* isolate = CcTest::i_isolate(); | 460   Isolate* isolate = CcTest::i_isolate(); | 
| 457   HandleScope handles(isolate); | 461   HandleScope handles(isolate); | 
| 458   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 462   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 463                            v8::internal::CodeObjectRequired::kYes); | 
| 459 | 464 | 
| 460   MacroAssembler* masm = &assembler; | 465   MacroAssembler* masm = &assembler; | 
| 461   EntryCode(masm); | 466   EntryCode(masm); | 
| 462   Label exit; | 467   Label exit; | 
| 463   Condition cond; | 468   Condition cond; | 
| 464 | 469 | 
| 465   __ movl(rax, Immediate(1));  // Test number. | 470   __ movl(rax, Immediate(1));  // Test number. | 
| 466 | 471 | 
| 467   // CheckSmi | 472   // CheckSmi | 
| 468 | 473 | 
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 667 | 672 | 
| 668 | 673 | 
| 669 TEST(SmiNeg) { | 674 TEST(SmiNeg) { | 
| 670   // Allocate an executable page of memory. | 675   // Allocate an executable page of memory. | 
| 671   size_t actual_size; | 676   size_t actual_size; | 
| 672   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 677   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 673       Assembler::kMinimalBufferSize, &actual_size, true)); | 678       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 674   CHECK(buffer); | 679   CHECK(buffer); | 
| 675   Isolate* isolate = CcTest::i_isolate(); | 680   Isolate* isolate = CcTest::i_isolate(); | 
| 676   HandleScope handles(isolate); | 681   HandleScope handles(isolate); | 
| 677   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 682   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 683                            v8::internal::CodeObjectRequired::kYes); | 
| 678 | 684 | 
| 679   MacroAssembler* masm = &assembler; | 685   MacroAssembler* masm = &assembler; | 
| 680   EntryCode(masm); | 686   EntryCode(masm); | 
| 681   Label exit; | 687   Label exit; | 
| 682 | 688 | 
| 683   TestSmiNeg(masm, &exit, 0x10, 0); | 689   TestSmiNeg(masm, &exit, 0x10, 0); | 
| 684   TestSmiNeg(masm, &exit, 0x20, 1); | 690   TestSmiNeg(masm, &exit, 0x20, 1); | 
| 685   TestSmiNeg(masm, &exit, 0x30, -1); | 691   TestSmiNeg(masm, &exit, 0x30, -1); | 
| 686   TestSmiNeg(masm, &exit, 0x40, 127); | 692   TestSmiNeg(masm, &exit, 0x40, 127); | 
| 687   TestSmiNeg(masm, &exit, 0x50, 65535); | 693   TestSmiNeg(masm, &exit, 0x50, 65535); | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 878 | 884 | 
| 879 | 885 | 
| 880 TEST(SmiAdd) { | 886 TEST(SmiAdd) { | 
| 881   // Allocate an executable page of memory. | 887   // Allocate an executable page of memory. | 
| 882   size_t actual_size; | 888   size_t actual_size; | 
| 883   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 889   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 884       Assembler::kMinimalBufferSize * 3, &actual_size, true)); | 890       Assembler::kMinimalBufferSize * 3, &actual_size, true)); | 
| 885   CHECK(buffer); | 891   CHECK(buffer); | 
| 886   Isolate* isolate = CcTest::i_isolate(); | 892   Isolate* isolate = CcTest::i_isolate(); | 
| 887   HandleScope handles(isolate); | 893   HandleScope handles(isolate); | 
| 888   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 894   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 895                            v8::internal::CodeObjectRequired::kYes); | 
| 889 | 896 | 
| 890   MacroAssembler* masm = &assembler; | 897   MacroAssembler* masm = &assembler; | 
| 891   EntryCode(masm); | 898   EntryCode(masm); | 
| 892   Label exit; | 899   Label exit; | 
| 893 | 900 | 
| 894   // No-overflow tests. | 901   // No-overflow tests. | 
| 895   SmiAddTest(masm, &exit, 0x10, 1, 2); | 902   SmiAddTest(masm, &exit, 0x10, 1, 2); | 
| 896   SmiAddTest(masm, &exit, 0x20, 1, -2); | 903   SmiAddTest(masm, &exit, 0x20, 1, -2); | 
| 897   SmiAddTest(masm, &exit, 0x30, -1, 2); | 904   SmiAddTest(masm, &exit, 0x30, -1, 2); | 
| 898   SmiAddTest(masm, &exit, 0x40, -1, -2); | 905   SmiAddTest(masm, &exit, 0x40, -1, -2); | 
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1094 | 1101 | 
| 1095 | 1102 | 
| 1096 TEST(SmiSub) { | 1103 TEST(SmiSub) { | 
| 1097   // Allocate an executable page of memory. | 1104   // Allocate an executable page of memory. | 
| 1098   size_t actual_size; | 1105   size_t actual_size; | 
| 1099   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1106   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1100       Assembler::kMinimalBufferSize * 4, &actual_size, true)); | 1107       Assembler::kMinimalBufferSize * 4, &actual_size, true)); | 
| 1101   CHECK(buffer); | 1108   CHECK(buffer); | 
| 1102   Isolate* isolate = CcTest::i_isolate(); | 1109   Isolate* isolate = CcTest::i_isolate(); | 
| 1103   HandleScope handles(isolate); | 1110   HandleScope handles(isolate); | 
| 1104   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1111   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1112                            v8::internal::CodeObjectRequired::kYes); | 
| 1105 | 1113 | 
| 1106   MacroAssembler* masm = &assembler; | 1114   MacroAssembler* masm = &assembler; | 
| 1107   EntryCode(masm); | 1115   EntryCode(masm); | 
| 1108   Label exit; | 1116   Label exit; | 
| 1109 | 1117 | 
| 1110   SmiSubTest(masm, &exit, 0x10, 1, 2); | 1118   SmiSubTest(masm, &exit, 0x10, 1, 2); | 
| 1111   SmiSubTest(masm, &exit, 0x20, 1, -2); | 1119   SmiSubTest(masm, &exit, 0x20, 1, -2); | 
| 1112   SmiSubTest(masm, &exit, 0x30, -1, 2); | 1120   SmiSubTest(masm, &exit, 0x30, -1, 2); | 
| 1113   SmiSubTest(masm, &exit, 0x40, -1, -2); | 1121   SmiSubTest(masm, &exit, 0x40, -1, -2); | 
| 1114   SmiSubTest(masm, &exit, 0x50, 0x1000, 0x2000); | 1122   SmiSubTest(masm, &exit, 0x50, 0x1000, 0x2000); | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1182 | 1190 | 
| 1183 | 1191 | 
| 1184 TEST(SmiMul) { | 1192 TEST(SmiMul) { | 
| 1185   // Allocate an executable page of memory. | 1193   // Allocate an executable page of memory. | 
| 1186   size_t actual_size; | 1194   size_t actual_size; | 
| 1187   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1195   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1188       Assembler::kMinimalBufferSize, &actual_size, true)); | 1196       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 1189   CHECK(buffer); | 1197   CHECK(buffer); | 
| 1190   Isolate* isolate = CcTest::i_isolate(); | 1198   Isolate* isolate = CcTest::i_isolate(); | 
| 1191   HandleScope handles(isolate); | 1199   HandleScope handles(isolate); | 
| 1192   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1200   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1201                            v8::internal::CodeObjectRequired::kYes); | 
| 1193 | 1202 | 
| 1194   MacroAssembler* masm = &assembler; | 1203   MacroAssembler* masm = &assembler; | 
| 1195   EntryCode(masm); | 1204   EntryCode(masm); | 
| 1196   Label exit; | 1205   Label exit; | 
| 1197 | 1206 | 
| 1198   TestSmiMul(masm, &exit, 0x10, 0, 0); | 1207   TestSmiMul(masm, &exit, 0x10, 0, 0); | 
| 1199   TestSmiMul(masm, &exit, 0x20, -1, 0); | 1208   TestSmiMul(masm, &exit, 0x20, -1, 0); | 
| 1200   TestSmiMul(masm, &exit, 0x30, 0, -1); | 1209   TestSmiMul(masm, &exit, 0x30, 0, -1); | 
| 1201   TestSmiMul(masm, &exit, 0x40, -1, -1); | 1210   TestSmiMul(masm, &exit, 0x40, -1, -1); | 
| 1202   TestSmiMul(masm, &exit, 0x50, 0x10000, 0x10000); | 1211   TestSmiMul(masm, &exit, 0x50, 0x10000, 0x10000); | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1285 | 1294 | 
| 1286 | 1295 | 
| 1287 TEST(SmiDiv) { | 1296 TEST(SmiDiv) { | 
| 1288   // Allocate an executable page of memory. | 1297   // Allocate an executable page of memory. | 
| 1289   size_t actual_size; | 1298   size_t actual_size; | 
| 1290   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1299   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1291       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1300       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1292   CHECK(buffer); | 1301   CHECK(buffer); | 
| 1293   Isolate* isolate = CcTest::i_isolate(); | 1302   Isolate* isolate = CcTest::i_isolate(); | 
| 1294   HandleScope handles(isolate); | 1303   HandleScope handles(isolate); | 
| 1295   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1304   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1305                            v8::internal::CodeObjectRequired::kYes); | 
| 1296 | 1306 | 
| 1297   MacroAssembler* masm = &assembler; | 1307   MacroAssembler* masm = &assembler; | 
| 1298   EntryCode(masm); | 1308   EntryCode(masm); | 
| 1299   Label exit; | 1309   Label exit; | 
| 1300 | 1310 | 
| 1301   __ pushq(r14); | 1311   __ pushq(r14); | 
| 1302   __ pushq(r15); | 1312   __ pushq(r15); | 
| 1303   TestSmiDiv(masm, &exit, 0x10, 1, 1); | 1313   TestSmiDiv(masm, &exit, 0x10, 1, 1); | 
| 1304   TestSmiDiv(masm, &exit, 0x20, 1, 0); | 1314   TestSmiDiv(masm, &exit, 0x20, 1, 0); | 
| 1305   TestSmiDiv(masm, &exit, 0x30, -1, 0); | 1315   TestSmiDiv(masm, &exit, 0x30, -1, 0); | 
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1392 | 1402 | 
| 1393 | 1403 | 
| 1394 TEST(SmiMod) { | 1404 TEST(SmiMod) { | 
| 1395   // Allocate an executable page of memory. | 1405   // Allocate an executable page of memory. | 
| 1396   size_t actual_size; | 1406   size_t actual_size; | 
| 1397   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1407   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1398       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1408       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1399   CHECK(buffer); | 1409   CHECK(buffer); | 
| 1400   Isolate* isolate = CcTest::i_isolate(); | 1410   Isolate* isolate = CcTest::i_isolate(); | 
| 1401   HandleScope handles(isolate); | 1411   HandleScope handles(isolate); | 
| 1402   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1412   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1413                            v8::internal::CodeObjectRequired::kYes); | 
| 1403 | 1414 | 
| 1404   MacroAssembler* masm = &assembler; | 1415   MacroAssembler* masm = &assembler; | 
| 1405   EntryCode(masm); | 1416   EntryCode(masm); | 
| 1406   Label exit; | 1417   Label exit; | 
| 1407 | 1418 | 
| 1408   __ pushq(r14); | 1419   __ pushq(r14); | 
| 1409   __ pushq(r15); | 1420   __ pushq(r15); | 
| 1410   TestSmiMod(masm, &exit, 0x10, 1, 1); | 1421   TestSmiMod(masm, &exit, 0x10, 1, 1); | 
| 1411   TestSmiMod(masm, &exit, 0x20, 1, 0); | 1422   TestSmiMod(masm, &exit, 0x20, 1, 0); | 
| 1412   TestSmiMod(masm, &exit, 0x30, -1, 0); | 1423   TestSmiMod(masm, &exit, 0x30, -1, 0); | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1486 | 1497 | 
| 1487 | 1498 | 
| 1488 TEST(SmiIndex) { | 1499 TEST(SmiIndex) { | 
| 1489   // Allocate an executable page of memory. | 1500   // Allocate an executable page of memory. | 
| 1490   size_t actual_size; | 1501   size_t actual_size; | 
| 1491   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1502   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1492       Assembler::kMinimalBufferSize * 5, &actual_size, true)); | 1503       Assembler::kMinimalBufferSize * 5, &actual_size, true)); | 
| 1493   CHECK(buffer); | 1504   CHECK(buffer); | 
| 1494   Isolate* isolate = CcTest::i_isolate(); | 1505   Isolate* isolate = CcTest::i_isolate(); | 
| 1495   HandleScope handles(isolate); | 1506   HandleScope handles(isolate); | 
| 1496   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1507   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1508                            v8::internal::CodeObjectRequired::kYes); | 
| 1497 | 1509 | 
| 1498   MacroAssembler* masm = &assembler; | 1510   MacroAssembler* masm = &assembler; | 
| 1499   EntryCode(masm); | 1511   EntryCode(masm); | 
| 1500   Label exit; | 1512   Label exit; | 
| 1501 | 1513 | 
| 1502   TestSmiIndex(masm, &exit, 0x10, 0); | 1514   TestSmiIndex(masm, &exit, 0x10, 0); | 
| 1503   TestSmiIndex(masm, &exit, 0x20, 1); | 1515   TestSmiIndex(masm, &exit, 0x20, 1); | 
| 1504   TestSmiIndex(masm, &exit, 0x30, 100); | 1516   TestSmiIndex(masm, &exit, 0x30, 100); | 
| 1505   TestSmiIndex(masm, &exit, 0x40, 1000); | 1517   TestSmiIndex(masm, &exit, 0x40, 1000); | 
| 1506   TestSmiIndex(masm, &exit, 0x50, Smi::kMaxValue); | 1518   TestSmiIndex(masm, &exit, 0x50, Smi::kMaxValue); | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1552 | 1564 | 
| 1553 | 1565 | 
| 1554 TEST(SmiSelectNonSmi) { | 1566 TEST(SmiSelectNonSmi) { | 
| 1555   // Allocate an executable page of memory. | 1567   // Allocate an executable page of memory. | 
| 1556   size_t actual_size; | 1568   size_t actual_size; | 
| 1557   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1569   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1558       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1570       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1559   CHECK(buffer); | 1571   CHECK(buffer); | 
| 1560   Isolate* isolate = CcTest::i_isolate(); | 1572   Isolate* isolate = CcTest::i_isolate(); | 
| 1561   HandleScope handles(isolate); | 1573   HandleScope handles(isolate); | 
| 1562   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1574   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1575                            v8::internal::CodeObjectRequired::kYes); | 
| 1563 | 1576 | 
| 1564   MacroAssembler* masm = &assembler; | 1577   MacroAssembler* masm = &assembler; | 
| 1565   EntryCode(masm); | 1578   EntryCode(masm); | 
| 1566   Label exit; | 1579   Label exit; | 
| 1567 | 1580 | 
| 1568   TestSelectNonSmi(masm, &exit, 0x10, 0, 0); | 1581   TestSelectNonSmi(masm, &exit, 0x10, 0, 0); | 
| 1569   TestSelectNonSmi(masm, &exit, 0x20, 0, 1); | 1582   TestSelectNonSmi(masm, &exit, 0x20, 0, 1); | 
| 1570   TestSelectNonSmi(masm, &exit, 0x30, 1, 0); | 1583   TestSelectNonSmi(masm, &exit, 0x30, 1, 0); | 
| 1571   TestSelectNonSmi(masm, &exit, 0x40, 0, -1); | 1584   TestSelectNonSmi(masm, &exit, 0x40, 0, -1); | 
| 1572   TestSelectNonSmi(masm, &exit, 0x50, -1, 0); | 1585   TestSelectNonSmi(masm, &exit, 0x50, -1, 0); | 
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1628 | 1641 | 
| 1629 | 1642 | 
| 1630 TEST(SmiAnd) { | 1643 TEST(SmiAnd) { | 
| 1631   // Allocate an executable page of memory. | 1644   // Allocate an executable page of memory. | 
| 1632   size_t actual_size; | 1645   size_t actual_size; | 
| 1633   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1646   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1634       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1647       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1635   CHECK(buffer); | 1648   CHECK(buffer); | 
| 1636   Isolate* isolate = CcTest::i_isolate(); | 1649   Isolate* isolate = CcTest::i_isolate(); | 
| 1637   HandleScope handles(isolate); | 1650   HandleScope handles(isolate); | 
| 1638   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1651   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1652                            v8::internal::CodeObjectRequired::kYes); | 
| 1639 | 1653 | 
| 1640   MacroAssembler* masm = &assembler; | 1654   MacroAssembler* masm = &assembler; | 
| 1641   EntryCode(masm); | 1655   EntryCode(masm); | 
| 1642   Label exit; | 1656   Label exit; | 
| 1643 | 1657 | 
| 1644   TestSmiAnd(masm, &exit, 0x10, 0, 0); | 1658   TestSmiAnd(masm, &exit, 0x10, 0, 0); | 
| 1645   TestSmiAnd(masm, &exit, 0x20, 0, 1); | 1659   TestSmiAnd(masm, &exit, 0x20, 0, 1); | 
| 1646   TestSmiAnd(masm, &exit, 0x30, 1, 0); | 1660   TestSmiAnd(masm, &exit, 0x30, 1, 0); | 
| 1647   TestSmiAnd(masm, &exit, 0x40, 0, -1); | 1661   TestSmiAnd(masm, &exit, 0x40, 0, -1); | 
| 1648   TestSmiAnd(masm, &exit, 0x50, -1, 0); | 1662   TestSmiAnd(masm, &exit, 0x50, -1, 0); | 
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1706 | 1720 | 
| 1707 | 1721 | 
| 1708 TEST(SmiOr) { | 1722 TEST(SmiOr) { | 
| 1709   // Allocate an executable page of memory. | 1723   // Allocate an executable page of memory. | 
| 1710   size_t actual_size; | 1724   size_t actual_size; | 
| 1711   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1725   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1712       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1726       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1713   CHECK(buffer); | 1727   CHECK(buffer); | 
| 1714   Isolate* isolate = CcTest::i_isolate(); | 1728   Isolate* isolate = CcTest::i_isolate(); | 
| 1715   HandleScope handles(isolate); | 1729   HandleScope handles(isolate); | 
| 1716   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1730   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1731                            v8::internal::CodeObjectRequired::kYes); | 
| 1717 | 1732 | 
| 1718   MacroAssembler* masm = &assembler; | 1733   MacroAssembler* masm = &assembler; | 
| 1719   EntryCode(masm); | 1734   EntryCode(masm); | 
| 1720   Label exit; | 1735   Label exit; | 
| 1721 | 1736 | 
| 1722   TestSmiOr(masm, &exit, 0x10, 0, 0); | 1737   TestSmiOr(masm, &exit, 0x10, 0, 0); | 
| 1723   TestSmiOr(masm, &exit, 0x20, 0, 1); | 1738   TestSmiOr(masm, &exit, 0x20, 0, 1); | 
| 1724   TestSmiOr(masm, &exit, 0x30, 1, 0); | 1739   TestSmiOr(masm, &exit, 0x30, 1, 0); | 
| 1725   TestSmiOr(masm, &exit, 0x40, 0, -1); | 1740   TestSmiOr(masm, &exit, 0x40, 0, -1); | 
| 1726   TestSmiOr(masm, &exit, 0x50, -1, 0); | 1741   TestSmiOr(masm, &exit, 0x50, -1, 0); | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1786 | 1801 | 
| 1787 | 1802 | 
| 1788 TEST(SmiXor) { | 1803 TEST(SmiXor) { | 
| 1789   // Allocate an executable page of memory. | 1804   // Allocate an executable page of memory. | 
| 1790   size_t actual_size; | 1805   size_t actual_size; | 
| 1791   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1806   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1792       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 1807       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 1793   CHECK(buffer); | 1808   CHECK(buffer); | 
| 1794   Isolate* isolate = CcTest::i_isolate(); | 1809   Isolate* isolate = CcTest::i_isolate(); | 
| 1795   HandleScope handles(isolate); | 1810   HandleScope handles(isolate); | 
| 1796   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1811   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1812                            v8::internal::CodeObjectRequired::kYes); | 
| 1797 | 1813 | 
| 1798   MacroAssembler* masm = &assembler; | 1814   MacroAssembler* masm = &assembler; | 
| 1799   EntryCode(masm); | 1815   EntryCode(masm); | 
| 1800   Label exit; | 1816   Label exit; | 
| 1801 | 1817 | 
| 1802   TestSmiXor(masm, &exit, 0x10, 0, 0); | 1818   TestSmiXor(masm, &exit, 0x10, 0, 0); | 
| 1803   TestSmiXor(masm, &exit, 0x20, 0, 1); | 1819   TestSmiXor(masm, &exit, 0x20, 0, 1); | 
| 1804   TestSmiXor(masm, &exit, 0x30, 1, 0); | 1820   TestSmiXor(masm, &exit, 0x30, 1, 0); | 
| 1805   TestSmiXor(masm, &exit, 0x40, 0, -1); | 1821   TestSmiXor(masm, &exit, 0x40, 0, -1); | 
| 1806   TestSmiXor(masm, &exit, 0x50, -1, 0); | 1822   TestSmiXor(masm, &exit, 0x50, -1, 0); | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1850 | 1866 | 
| 1851 | 1867 | 
| 1852 TEST(SmiNot) { | 1868 TEST(SmiNot) { | 
| 1853   // Allocate an executable page of memory. | 1869   // Allocate an executable page of memory. | 
| 1854   size_t actual_size; | 1870   size_t actual_size; | 
| 1855   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1871   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1856       Assembler::kMinimalBufferSize, &actual_size, true)); | 1872       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 1857   CHECK(buffer); | 1873   CHECK(buffer); | 
| 1858   Isolate* isolate = CcTest::i_isolate(); | 1874   Isolate* isolate = CcTest::i_isolate(); | 
| 1859   HandleScope handles(isolate); | 1875   HandleScope handles(isolate); | 
| 1860   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1876   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1877                            v8::internal::CodeObjectRequired::kYes); | 
| 1861 | 1878 | 
| 1862   MacroAssembler* masm = &assembler; | 1879   MacroAssembler* masm = &assembler; | 
| 1863   EntryCode(masm); | 1880   EntryCode(masm); | 
| 1864   Label exit; | 1881   Label exit; | 
| 1865 | 1882 | 
| 1866   TestSmiNot(masm, &exit, 0x10, 0); | 1883   TestSmiNot(masm, &exit, 0x10, 0); | 
| 1867   TestSmiNot(masm, &exit, 0x20, 1); | 1884   TestSmiNot(masm, &exit, 0x20, 1); | 
| 1868   TestSmiNot(masm, &exit, 0x30, -1); | 1885   TestSmiNot(masm, &exit, 0x30, -1); | 
| 1869   TestSmiNot(masm, &exit, 0x40, 127); | 1886   TestSmiNot(masm, &exit, 0x40, 127); | 
| 1870   TestSmiNot(masm, &exit, 0x50, 65535); | 1887   TestSmiNot(masm, &exit, 0x50, 65535); | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1943 | 1960 | 
| 1944 | 1961 | 
| 1945 TEST(SmiShiftLeft) { | 1962 TEST(SmiShiftLeft) { | 
| 1946   // Allocate an executable page of memory. | 1963   // Allocate an executable page of memory. | 
| 1947   size_t actual_size; | 1964   size_t actual_size; | 
| 1948   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 1965   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 1949       Assembler::kMinimalBufferSize * 7, &actual_size, true)); | 1966       Assembler::kMinimalBufferSize * 7, &actual_size, true)); | 
| 1950   CHECK(buffer); | 1967   CHECK(buffer); | 
| 1951   Isolate* isolate = CcTest::i_isolate(); | 1968   Isolate* isolate = CcTest::i_isolate(); | 
| 1952   HandleScope handles(isolate); | 1969   HandleScope handles(isolate); | 
| 1953   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 1970   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 1971                            v8::internal::CodeObjectRequired::kYes); | 
| 1954 | 1972 | 
| 1955   MacroAssembler* masm = &assembler; | 1973   MacroAssembler* masm = &assembler; | 
| 1956   EntryCode(masm); | 1974   EntryCode(masm); | 
| 1957   Label exit; | 1975   Label exit; | 
| 1958 | 1976 | 
| 1959   TestSmiShiftLeft(masm, &exit, 0x10, 0); | 1977   TestSmiShiftLeft(masm, &exit, 0x10, 0); | 
| 1960   TestSmiShiftLeft(masm, &exit, 0x50, 1); | 1978   TestSmiShiftLeft(masm, &exit, 0x50, 1); | 
| 1961   TestSmiShiftLeft(masm, &exit, 0x90, 127); | 1979   TestSmiShiftLeft(masm, &exit, 0x90, 127); | 
| 1962   TestSmiShiftLeft(masm, &exit, 0xD0, 65535); | 1980   TestSmiShiftLeft(masm, &exit, 0xD0, 65535); | 
| 1963   TestSmiShiftLeft(masm, &exit, 0x110, Smi::kMaxValue); | 1981   TestSmiShiftLeft(masm, &exit, 0x110, Smi::kMaxValue); | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2046 | 2064 | 
| 2047 | 2065 | 
| 2048 TEST(SmiShiftLogicalRight) { | 2066 TEST(SmiShiftLogicalRight) { | 
| 2049   // Allocate an executable page of memory. | 2067   // Allocate an executable page of memory. | 
| 2050   size_t actual_size; | 2068   size_t actual_size; | 
| 2051   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 2069   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 2052       Assembler::kMinimalBufferSize * 5, &actual_size, true)); | 2070       Assembler::kMinimalBufferSize * 5, &actual_size, true)); | 
| 2053   CHECK(buffer); | 2071   CHECK(buffer); | 
| 2054   Isolate* isolate = CcTest::i_isolate(); | 2072   Isolate* isolate = CcTest::i_isolate(); | 
| 2055   HandleScope handles(isolate); | 2073   HandleScope handles(isolate); | 
| 2056   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 2074   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 2075                            v8::internal::CodeObjectRequired::kYes); | 
| 2057 | 2076 | 
| 2058   MacroAssembler* masm = &assembler; | 2077   MacroAssembler* masm = &assembler; | 
| 2059   EntryCode(masm); | 2078   EntryCode(masm); | 
| 2060   Label exit; | 2079   Label exit; | 
| 2061 | 2080 | 
| 2062   TestSmiShiftLogicalRight(masm, &exit, 0x10, 0); | 2081   TestSmiShiftLogicalRight(masm, &exit, 0x10, 0); | 
| 2063   TestSmiShiftLogicalRight(masm, &exit, 0x30, 1); | 2082   TestSmiShiftLogicalRight(masm, &exit, 0x30, 1); | 
| 2064   TestSmiShiftLogicalRight(masm, &exit, 0x50, 127); | 2083   TestSmiShiftLogicalRight(masm, &exit, 0x50, 127); | 
| 2065   TestSmiShiftLogicalRight(masm, &exit, 0x70, 65535); | 2084   TestSmiShiftLogicalRight(masm, &exit, 0x70, 65535); | 
| 2066   TestSmiShiftLogicalRight(masm, &exit, 0x90, Smi::kMaxValue); | 2085   TestSmiShiftLogicalRight(masm, &exit, 0x90, Smi::kMaxValue); | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2112 | 2131 | 
| 2113 | 2132 | 
| 2114 TEST(SmiShiftArithmeticRight) { | 2133 TEST(SmiShiftArithmeticRight) { | 
| 2115   // Allocate an executable page of memory. | 2134   // Allocate an executable page of memory. | 
| 2116   size_t actual_size; | 2135   size_t actual_size; | 
| 2117   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 2136   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 2118       Assembler::kMinimalBufferSize * 3, &actual_size, true)); | 2137       Assembler::kMinimalBufferSize * 3, &actual_size, true)); | 
| 2119   CHECK(buffer); | 2138   CHECK(buffer); | 
| 2120   Isolate* isolate = CcTest::i_isolate(); | 2139   Isolate* isolate = CcTest::i_isolate(); | 
| 2121   HandleScope handles(isolate); | 2140   HandleScope handles(isolate); | 
| 2122   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 2141   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 2142                            v8::internal::CodeObjectRequired::kYes); | 
| 2123 | 2143 | 
| 2124   MacroAssembler* masm = &assembler; | 2144   MacroAssembler* masm = &assembler; | 
| 2125   EntryCode(masm); | 2145   EntryCode(masm); | 
| 2126   Label exit; | 2146   Label exit; | 
| 2127 | 2147 | 
| 2128   TestSmiShiftArithmeticRight(masm, &exit, 0x10, 0); | 2148   TestSmiShiftArithmeticRight(masm, &exit, 0x10, 0); | 
| 2129   TestSmiShiftArithmeticRight(masm, &exit, 0x20, 1); | 2149   TestSmiShiftArithmeticRight(masm, &exit, 0x20, 1); | 
| 2130   TestSmiShiftArithmeticRight(masm, &exit, 0x30, 127); | 2150   TestSmiShiftArithmeticRight(masm, &exit, 0x30, 127); | 
| 2131   TestSmiShiftArithmeticRight(masm, &exit, 0x40, 65535); | 2151   TestSmiShiftArithmeticRight(masm, &exit, 0x40, 65535); | 
| 2132   TestSmiShiftArithmeticRight(masm, &exit, 0x50, Smi::kMaxValue); | 2152   TestSmiShiftArithmeticRight(masm, &exit, 0x50, Smi::kMaxValue); | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2173 | 2193 | 
| 2174 | 2194 | 
| 2175 TEST(PositiveSmiTimesPowerOfTwoToInteger64) { | 2195 TEST(PositiveSmiTimesPowerOfTwoToInteger64) { | 
| 2176   // Allocate an executable page of memory. | 2196   // Allocate an executable page of memory. | 
| 2177   size_t actual_size; | 2197   size_t actual_size; | 
| 2178   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 2198   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 2179       Assembler::kMinimalBufferSize * 4, &actual_size, true)); | 2199       Assembler::kMinimalBufferSize * 4, &actual_size, true)); | 
| 2180   CHECK(buffer); | 2200   CHECK(buffer); | 
| 2181   Isolate* isolate = CcTest::i_isolate(); | 2201   Isolate* isolate = CcTest::i_isolate(); | 
| 2182   HandleScope handles(isolate); | 2202   HandleScope handles(isolate); | 
| 2183   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 2203   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 2204                            v8::internal::CodeObjectRequired::kYes); | 
| 2184 | 2205 | 
| 2185   MacroAssembler* masm = &assembler; | 2206   MacroAssembler* masm = &assembler; | 
| 2186   EntryCode(masm); | 2207   EntryCode(masm); | 
| 2187   Label exit; | 2208   Label exit; | 
| 2188 | 2209 | 
| 2189   TestPositiveSmiPowerUp(masm, &exit, 0x20, 0); | 2210   TestPositiveSmiPowerUp(masm, &exit, 0x20, 0); | 
| 2190   TestPositiveSmiPowerUp(masm, &exit, 0x40, 1); | 2211   TestPositiveSmiPowerUp(masm, &exit, 0x40, 1); | 
| 2191   TestPositiveSmiPowerUp(masm, &exit, 0x60, 127); | 2212   TestPositiveSmiPowerUp(masm, &exit, 0x60, 127); | 
| 2192   TestPositiveSmiPowerUp(masm, &exit, 0x80, 128); | 2213   TestPositiveSmiPowerUp(masm, &exit, 0x80, 128); | 
| 2193   TestPositiveSmiPowerUp(masm, &exit, 0xA0, 255); | 2214   TestPositiveSmiPowerUp(masm, &exit, 0xA0, 255); | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 2213   uint32_t data[256]; | 2234   uint32_t data[256]; | 
| 2214   for (uint32_t i = 0; i < 256; i++) { data[i] = i * 0x01010101; } | 2235   for (uint32_t i = 0; i < 256; i++) { data[i] = i * 0x01010101; } | 
| 2215 | 2236 | 
| 2216   // Allocate an executable page of memory. | 2237   // Allocate an executable page of memory. | 
| 2217   size_t actual_size; | 2238   size_t actual_size; | 
| 2218   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 2239   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 2219       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 2240       Assembler::kMinimalBufferSize * 2, &actual_size, true)); | 
| 2220   CHECK(buffer); | 2241   CHECK(buffer); | 
| 2221   Isolate* isolate = CcTest::i_isolate(); | 2242   Isolate* isolate = CcTest::i_isolate(); | 
| 2222   HandleScope handles(isolate); | 2243   HandleScope handles(isolate); | 
| 2223   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 2244   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 2245                            v8::internal::CodeObjectRequired::kYes); | 
| 2224 | 2246 | 
| 2225   MacroAssembler* masm = &assembler; | 2247   MacroAssembler* masm = &assembler; | 
| 2226   Label exit; | 2248   Label exit; | 
| 2227 | 2249 | 
| 2228   EntryCode(masm); | 2250   EntryCode(masm); | 
| 2229   __ pushq(r13); | 2251   __ pushq(r13); | 
| 2230   __ pushq(r14); | 2252   __ pushq(r14); | 
| 2231   __ pushq(rbx); | 2253   __ pushq(rbx); | 
| 2232   __ pushq(rbp); | 2254   __ pushq(rbp); | 
| 2233   __ pushq(Immediate(0x100));  // <-- rbp | 2255   __ pushq(Immediate(0x100));  // <-- rbp | 
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2563 | 2585 | 
| 2564 | 2586 | 
| 2565 TEST(LoadAndStoreWithRepresentation) { | 2587 TEST(LoadAndStoreWithRepresentation) { | 
| 2566   // Allocate an executable page of memory. | 2588   // Allocate an executable page of memory. | 
| 2567   size_t actual_size; | 2589   size_t actual_size; | 
| 2568   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 2590   byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 
| 2569       Assembler::kMinimalBufferSize, &actual_size, true)); | 2591       Assembler::kMinimalBufferSize, &actual_size, true)); | 
| 2570   CHECK(buffer); | 2592   CHECK(buffer); | 
| 2571   Isolate* isolate = CcTest::i_isolate(); | 2593   Isolate* isolate = CcTest::i_isolate(); | 
| 2572   HandleScope handles(isolate); | 2594   HandleScope handles(isolate); | 
| 2573   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size)); | 2595   MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size), | 
|  | 2596                            v8::internal::CodeObjectRequired::kYes); | 
| 2574   MacroAssembler* masm = &assembler;  // Create a pointer for the __ macro. | 2597   MacroAssembler* masm = &assembler;  // Create a pointer for the __ macro. | 
| 2575   EntryCode(masm); | 2598   EntryCode(masm); | 
| 2576   __ subq(rsp, Immediate(1 * kPointerSize)); | 2599   __ subq(rsp, Immediate(1 * kPointerSize)); | 
| 2577   Label exit; | 2600   Label exit; | 
| 2578 | 2601 | 
| 2579   // Test 1. | 2602   // Test 1. | 
| 2580   __ movq(rax, Immediate(1));  // Test number. | 2603   __ movq(rax, Immediate(1));  // Test number. | 
| 2581   __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0)); | 2604   __ movq(Operand(rsp, 0 * kPointerSize), Immediate(0)); | 
| 2582   __ movq(rcx, Immediate(-1)); | 2605   __ movq(rcx, Immediate(-1)); | 
| 2583   __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger8()); | 2606   __ Store(Operand(rsp, 0 * kPointerSize), rcx, Representation::UInteger8()); | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2703 | 2726 | 
| 2704   CodeDesc desc; | 2727   CodeDesc desc; | 
| 2705   masm->GetCode(&desc); | 2728   masm->GetCode(&desc); | 
| 2706   // Call the function from C++. | 2729   // Call the function from C++. | 
| 2707   int result = FUNCTION_CAST<F0>(buffer)(); | 2730   int result = FUNCTION_CAST<F0>(buffer)(); | 
| 2708   CHECK_EQ(0, result); | 2731   CHECK_EQ(0, result); | 
| 2709 } | 2732 } | 
| 2710 | 2733 | 
| 2711 | 2734 | 
| 2712 #undef __ | 2735 #undef __ | 
| OLD | NEW | 
|---|