OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 Assembler assm(isolate, NULL, 0); | 53 Assembler assm(isolate, NULL, 0); |
54 | 54 |
55 __ add(r0, r0, Operand(r1)); | 55 __ add(r0, r0, Operand(r1)); |
56 __ mov(pc, Operand(lr)); | 56 __ mov(pc, Operand(lr)); |
57 | 57 |
58 CodeDesc desc; | 58 CodeDesc desc; |
59 assm.GetCode(&desc); | 59 assm.GetCode(&desc); |
60 Handle<Code> code = isolate->factory()->NewCode( | 60 Handle<Code> code = isolate->factory()->NewCode( |
61 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 61 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
62 #ifdef DEBUG | 62 #ifdef DEBUG |
63 code->Print(); | 63 OFStream os(stdout); |
| 64 code->Print(os); |
64 #endif | 65 #endif |
65 F2 f = FUNCTION_CAST<F2>(code->entry()); | 66 F2 f = FUNCTION_CAST<F2>(code->entry()); |
66 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 3, 4, 0, 0, 0)); | 67 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 3, 4, 0, 0, 0)); |
67 ::printf("f() = %d\n", res); | 68 ::printf("f() = %d\n", res); |
68 CHECK_EQ(7, res); | 69 CHECK_EQ(7, res); |
69 } | 70 } |
70 | 71 |
71 | 72 |
72 TEST(1) { | 73 TEST(1) { |
73 CcTest::InitializeVM(); | 74 CcTest::InitializeVM(); |
(...skipping 14 matching lines...) Expand all Loading... |
88 __ bind(&C); | 89 __ bind(&C); |
89 __ teq(r1, Operand::Zero()); | 90 __ teq(r1, Operand::Zero()); |
90 __ b(ne, &L); | 91 __ b(ne, &L); |
91 __ mov(pc, Operand(lr)); | 92 __ mov(pc, Operand(lr)); |
92 | 93 |
93 CodeDesc desc; | 94 CodeDesc desc; |
94 assm.GetCode(&desc); | 95 assm.GetCode(&desc); |
95 Handle<Code> code = isolate->factory()->NewCode( | 96 Handle<Code> code = isolate->factory()->NewCode( |
96 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 97 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
97 #ifdef DEBUG | 98 #ifdef DEBUG |
98 code->Print(); | 99 OFStream os(stdout); |
| 100 code->Print(os); |
99 #endif | 101 #endif |
100 F1 f = FUNCTION_CAST<F1>(code->entry()); | 102 F1 f = FUNCTION_CAST<F1>(code->entry()); |
101 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 100, 0, 0, 0, 0)); | 103 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 100, 0, 0, 0, 0)); |
102 ::printf("f() = %d\n", res); | 104 ::printf("f() = %d\n", res); |
103 CHECK_EQ(5050, res); | 105 CHECK_EQ(5050, res); |
104 } | 106 } |
105 | 107 |
106 | 108 |
107 TEST(2) { | 109 TEST(2) { |
108 CcTest::InitializeVM(); | 110 CcTest::InitializeVM(); |
(...skipping 23 matching lines...) Expand all Loading... |
132 __ mov(r0, Operand(-1)); | 134 __ mov(r0, Operand(-1)); |
133 __ mov(r0, Operand(0xFF000000)); | 135 __ mov(r0, Operand(0xFF000000)); |
134 __ mov(r0, Operand(0xF0F0F0F0)); | 136 __ mov(r0, Operand(0xF0F0F0F0)); |
135 __ mov(r0, Operand(0xFFF0FFFF)); | 137 __ mov(r0, Operand(0xFFF0FFFF)); |
136 | 138 |
137 CodeDesc desc; | 139 CodeDesc desc; |
138 assm.GetCode(&desc); | 140 assm.GetCode(&desc); |
139 Handle<Code> code = isolate->factory()->NewCode( | 141 Handle<Code> code = isolate->factory()->NewCode( |
140 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 142 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
141 #ifdef DEBUG | 143 #ifdef DEBUG |
142 code->Print(); | 144 OFStream os(stdout); |
| 145 code->Print(os); |
143 #endif | 146 #endif |
144 F1 f = FUNCTION_CAST<F1>(code->entry()); | 147 F1 f = FUNCTION_CAST<F1>(code->entry()); |
145 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 10, 0, 0, 0, 0)); | 148 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 10, 0, 0, 0, 0)); |
146 ::printf("f() = %d\n", res); | 149 ::printf("f() = %d\n", res); |
147 CHECK_EQ(3628800, res); | 150 CHECK_EQ(3628800, res); |
148 } | 151 } |
149 | 152 |
150 | 153 |
151 TEST(3) { | 154 TEST(3) { |
152 CcTest::InitializeVM(); | 155 CcTest::InitializeVM(); |
(...skipping 25 matching lines...) Expand all Loading... |
178 __ add(r0, r2, Operand(r0)); | 181 __ add(r0, r2, Operand(r0)); |
179 __ mov(r2, Operand(r2, ASR, 3)); | 182 __ mov(r2, Operand(r2, ASR, 3)); |
180 __ strh(r2, MemOperand(r4, OFFSET_OF(T, s))); | 183 __ strh(r2, MemOperand(r4, OFFSET_OF(T, s))); |
181 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 184 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
182 | 185 |
183 CodeDesc desc; | 186 CodeDesc desc; |
184 assm.GetCode(&desc); | 187 assm.GetCode(&desc); |
185 Handle<Code> code = isolate->factory()->NewCode( | 188 Handle<Code> code = isolate->factory()->NewCode( |
186 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 189 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
187 #ifdef DEBUG | 190 #ifdef DEBUG |
188 code->Print(); | 191 OFStream os(stdout); |
| 192 code->Print(os); |
189 #endif | 193 #endif |
190 F3 f = FUNCTION_CAST<F3>(code->entry()); | 194 F3 f = FUNCTION_CAST<F3>(code->entry()); |
191 t.i = 100000; | 195 t.i = 100000; |
192 t.c = 10; | 196 t.c = 10; |
193 t.s = 1000; | 197 t.s = 1000; |
194 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0)); | 198 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0)); |
195 ::printf("f() = %d\n", res); | 199 ::printf("f() = %d\n", res); |
196 CHECK_EQ(101010, res); | 200 CHECK_EQ(101010, res); |
197 CHECK_EQ(100000/2, t.i); | 201 CHECK_EQ(100000/2, t.i); |
198 CHECK_EQ(10*4, t.c); | 202 CHECK_EQ(10*4, t.c); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 __ vneg(d0, d1); | 305 __ vneg(d0, d1); |
302 __ vstr(d0, r4, OFFSET_OF(T, n)); | 306 __ vstr(d0, r4, OFFSET_OF(T, n)); |
303 | 307 |
304 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 308 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
305 | 309 |
306 CodeDesc desc; | 310 CodeDesc desc; |
307 assm.GetCode(&desc); | 311 assm.GetCode(&desc); |
308 Handle<Code> code = isolate->factory()->NewCode( | 312 Handle<Code> code = isolate->factory()->NewCode( |
309 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 313 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
310 #ifdef DEBUG | 314 #ifdef DEBUG |
311 code->Print(); | 315 OFStream os(stdout); |
| 316 code->Print(os); |
312 #endif | 317 #endif |
313 F3 f = FUNCTION_CAST<F3>(code->entry()); | 318 F3 f = FUNCTION_CAST<F3>(code->entry()); |
314 t.a = 1.5; | 319 t.a = 1.5; |
315 t.b = 2.75; | 320 t.b = 2.75; |
316 t.c = 17.17; | 321 t.c = 17.17; |
317 t.d = 0.0; | 322 t.d = 0.0; |
318 t.e = 0.0; | 323 t.e = 0.0; |
319 t.f = 0.0; | 324 t.f = 0.0; |
320 t.g = -2718.2818; | 325 t.g = -2718.2818; |
321 t.h = 31415926.5; | 326 t.h = 31415926.5; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 __ bfc(r0, 1, 3); // 0b11..111111110001 = -15 | 366 __ bfc(r0, 1, 3); // 0b11..111111110001 = -15 |
362 __ mov(r1, Operand(7)); | 367 __ mov(r1, Operand(7)); |
363 __ bfi(r0, r1, 3, 3); // 0b11..111111111001 = -7 | 368 __ bfi(r0, r1, 3, 3); // 0b11..111111111001 = -7 |
364 __ mov(pc, Operand(lr)); | 369 __ mov(pc, Operand(lr)); |
365 | 370 |
366 CodeDesc desc; | 371 CodeDesc desc; |
367 assm.GetCode(&desc); | 372 assm.GetCode(&desc); |
368 Handle<Code> code = isolate->factory()->NewCode( | 373 Handle<Code> code = isolate->factory()->NewCode( |
369 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 374 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
370 #ifdef DEBUG | 375 #ifdef DEBUG |
371 code->Print(); | 376 OFStream os(stdout); |
| 377 code->Print(os); |
372 #endif | 378 #endif |
373 F1 f = FUNCTION_CAST<F1>(code->entry()); | 379 F1 f = FUNCTION_CAST<F1>(code->entry()); |
374 int res = reinterpret_cast<int>( | 380 int res = reinterpret_cast<int>( |
375 CALL_GENERATED_CODE(f, 0xAAAAAAAA, 0, 0, 0, 0)); | 381 CALL_GENERATED_CODE(f, 0xAAAAAAAA, 0, 0, 0, 0)); |
376 ::printf("f() = %d\n", res); | 382 ::printf("f() = %d\n", res); |
377 CHECK_EQ(-7, res); | 383 CHECK_EQ(-7, res); |
378 } | 384 } |
379 } | 385 } |
380 | 386 |
381 | 387 |
(...skipping 12 matching lines...) Expand all Loading... |
394 __ usat(r3, 1, Operand(r0, LSL, 16)); // Sat (0xFFFF<<16) to 0-1 = 0x0. | 400 __ usat(r3, 1, Operand(r0, LSL, 16)); // Sat (0xFFFF<<16) to 0-1 = 0x0. |
395 __ add(r0, r1, Operand(r2)); | 401 __ add(r0, r1, Operand(r2)); |
396 __ add(r0, r0, Operand(r3)); | 402 __ add(r0, r0, Operand(r3)); |
397 __ mov(pc, Operand(lr)); | 403 __ mov(pc, Operand(lr)); |
398 | 404 |
399 CodeDesc desc; | 405 CodeDesc desc; |
400 assm.GetCode(&desc); | 406 assm.GetCode(&desc); |
401 Handle<Code> code = isolate->factory()->NewCode( | 407 Handle<Code> code = isolate->factory()->NewCode( |
402 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 408 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
403 #ifdef DEBUG | 409 #ifdef DEBUG |
404 code->Print(); | 410 OFStream os(stdout); |
| 411 code->Print(os); |
405 #endif | 412 #endif |
406 F1 f = FUNCTION_CAST<F1>(code->entry()); | 413 F1 f = FUNCTION_CAST<F1>(code->entry()); |
407 int res = reinterpret_cast<int>( | 414 int res = reinterpret_cast<int>( |
408 CALL_GENERATED_CODE(f, 0xFFFF, 0, 0, 0, 0)); | 415 CALL_GENERATED_CODE(f, 0xFFFF, 0, 0, 0, 0)); |
409 ::printf("f() = %d\n", res); | 416 ::printf("f() = %d\n", res); |
410 CHECK_EQ(382, res); | 417 CHECK_EQ(382, res); |
411 } | 418 } |
412 } | 419 } |
413 | 420 |
414 | 421 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 // Load a special value and return. | 474 // Load a special value and return. |
468 __ bind(&wrong_exception); | 475 __ bind(&wrong_exception); |
469 __ mov(r0, Operand(11223344)); | 476 __ mov(r0, Operand(11223344)); |
470 __ mov(pc, Operand(lr)); | 477 __ mov(pc, Operand(lr)); |
471 | 478 |
472 CodeDesc desc; | 479 CodeDesc desc; |
473 assm.GetCode(&desc); | 480 assm.GetCode(&desc); |
474 Handle<Code> code = isolate->factory()->NewCode( | 481 Handle<Code> code = isolate->factory()->NewCode( |
475 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 482 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
476 #ifdef DEBUG | 483 #ifdef DEBUG |
477 code->Print(); | 484 OFStream os(stdout); |
| 485 code->Print(os); |
478 #endif | 486 #endif |
479 F1 f = FUNCTION_CAST<F1>(code->entry()); | 487 F1 f = FUNCTION_CAST<F1>(code->entry()); |
480 int res = reinterpret_cast<int>( | 488 int res = reinterpret_cast<int>( |
481 CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 489 CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); |
482 ::printf("res = %d\n", res); | 490 ::printf("res = %d\n", res); |
483 CHECK_EQ(expected, res); | 491 CHECK_EQ(expected, res); |
484 } | 492 } |
485 } | 493 } |
486 | 494 |
487 | 495 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 __ vstm(ia_w, r4, s6, s7); | 658 __ vstm(ia_w, r4, s6, s7); |
651 __ vstm(ia_w, r4, s0, s5); | 659 __ vstm(ia_w, r4, s0, s5); |
652 | 660 |
653 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 661 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
654 | 662 |
655 CodeDesc desc; | 663 CodeDesc desc; |
656 assm.GetCode(&desc); | 664 assm.GetCode(&desc); |
657 Handle<Code> code = isolate->factory()->NewCode( | 665 Handle<Code> code = isolate->factory()->NewCode( |
658 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 666 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
659 #ifdef DEBUG | 667 #ifdef DEBUG |
660 code->Print(); | 668 OFStream os(stdout); |
| 669 code->Print(os); |
661 #endif | 670 #endif |
662 F4 fn = FUNCTION_CAST<F4>(code->entry()); | 671 F4 fn = FUNCTION_CAST<F4>(code->entry()); |
663 d.a = 1.1; | 672 d.a = 1.1; |
664 d.b = 2.2; | 673 d.b = 2.2; |
665 d.c = 3.3; | 674 d.c = 3.3; |
666 d.d = 4.4; | 675 d.d = 4.4; |
667 d.e = 5.5; | 676 d.e = 5.5; |
668 d.f = 6.6; | 677 d.f = 6.6; |
669 d.g = 7.7; | 678 d.g = 7.7; |
670 d.h = 8.8; | 679 d.h = 8.8; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 __ add(r4, r4, Operand(2 * 4)); | 768 __ add(r4, r4, Operand(2 * 4)); |
760 __ vstm(ia, r4, s0, s5); | 769 __ vstm(ia, r4, s0, s5); |
761 | 770 |
762 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 771 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
763 | 772 |
764 CodeDesc desc; | 773 CodeDesc desc; |
765 assm.GetCode(&desc); | 774 assm.GetCode(&desc); |
766 Handle<Code> code = isolate->factory()->NewCode( | 775 Handle<Code> code = isolate->factory()->NewCode( |
767 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 776 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
768 #ifdef DEBUG | 777 #ifdef DEBUG |
769 code->Print(); | 778 OFStream os(stdout); |
| 779 code->Print(os); |
770 #endif | 780 #endif |
771 F4 fn = FUNCTION_CAST<F4>(code->entry()); | 781 F4 fn = FUNCTION_CAST<F4>(code->entry()); |
772 d.a = 1.1; | 782 d.a = 1.1; |
773 d.b = 2.2; | 783 d.b = 2.2; |
774 d.c = 3.3; | 784 d.c = 3.3; |
775 d.d = 4.4; | 785 d.d = 4.4; |
776 d.e = 5.5; | 786 d.e = 5.5; |
777 d.f = 6.6; | 787 d.f = 6.6; |
778 d.g = 7.7; | 788 d.g = 7.7; |
779 d.h = 8.8; | 789 d.h = 8.8; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 __ vstm(db_w, r4, s0, s5); | 874 __ vstm(db_w, r4, s0, s5); |
865 __ vstm(db_w, r4, s6, s7); | 875 __ vstm(db_w, r4, s6, s7); |
866 | 876 |
867 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 877 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
868 | 878 |
869 CodeDesc desc; | 879 CodeDesc desc; |
870 assm.GetCode(&desc); | 880 assm.GetCode(&desc); |
871 Handle<Code> code = isolate->factory()->NewCode( | 881 Handle<Code> code = isolate->factory()->NewCode( |
872 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 882 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
873 #ifdef DEBUG | 883 #ifdef DEBUG |
874 code->Print(); | 884 OFStream os(stdout); |
| 885 code->Print(os); |
875 #endif | 886 #endif |
876 F4 fn = FUNCTION_CAST<F4>(code->entry()); | 887 F4 fn = FUNCTION_CAST<F4>(code->entry()); |
877 d.a = 1.1; | 888 d.a = 1.1; |
878 d.b = 2.2; | 889 d.b = 2.2; |
879 d.c = 3.3; | 890 d.c = 3.3; |
880 d.d = 4.4; | 891 d.d = 4.4; |
881 d.e = 5.5; | 892 d.e = 5.5; |
882 d.f = 6.6; | 893 d.f = 6.6; |
883 d.g = 7.7; | 894 d.g = 7.7; |
884 d.h = 8.8; | 895 d.h = 8.8; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 __ adc(r3, r1, Operand(r2)); | 969 __ adc(r3, r1, Operand(r2)); |
959 __ str(r3, MemOperand(r0, OFFSET_OF(I, d))); | 970 __ str(r3, MemOperand(r0, OFFSET_OF(I, d))); |
960 | 971 |
961 __ mov(pc, Operand(lr)); | 972 __ mov(pc, Operand(lr)); |
962 | 973 |
963 CodeDesc desc; | 974 CodeDesc desc; |
964 assm.GetCode(&desc); | 975 assm.GetCode(&desc); |
965 Handle<Code> code = isolate->factory()->NewCode( | 976 Handle<Code> code = isolate->factory()->NewCode( |
966 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 977 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
967 #ifdef DEBUG | 978 #ifdef DEBUG |
968 code->Print(); | 979 OFStream os(stdout); |
| 980 code->Print(os); |
969 #endif | 981 #endif |
970 F3 f = FUNCTION_CAST<F3>(code->entry()); | 982 F3 f = FUNCTION_CAST<F3>(code->entry()); |
971 Object* dummy = CALL_GENERATED_CODE(f, &i, 0, 0, 0, 0); | 983 Object* dummy = CALL_GENERATED_CODE(f, &i, 0, 0, 0, 0); |
972 USE(dummy); | 984 USE(dummy); |
973 | 985 |
974 CHECK_EQ(0xabcd0001, i.a); | 986 CHECK_EQ(0xabcd0001, i.a); |
975 CHECK_EQ(static_cast<int32_t>(0xabcd0000) >> 1, i.b); | 987 CHECK_EQ(static_cast<int32_t>(0xabcd0000) >> 1, i.b); |
976 CHECK_EQ(0x00000000, i.c); | 988 CHECK_EQ(0x00000000, i.c); |
977 CHECK_EQ(0xffffffff, i.d); | 989 CHECK_EQ(0xffffffff, i.d); |
978 } | 990 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 __ vmov(r4, VmovIndexHi, d22); | 1097 __ vmov(r4, VmovIndexHi, d22); |
1086 __ str(r4, MemOperand(r0, OFFSET_OF(T, high))); | 1098 __ str(r4, MemOperand(r0, OFFSET_OF(T, high))); |
1087 | 1099 |
1088 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1100 __ ldm(ia_w, sp, r4.bit() | pc.bit()); |
1089 | 1101 |
1090 CodeDesc desc; | 1102 CodeDesc desc; |
1091 assm.GetCode(&desc); | 1103 assm.GetCode(&desc); |
1092 Handle<Code> code = isolate->factory()->NewCode( | 1104 Handle<Code> code = isolate->factory()->NewCode( |
1093 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1105 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1094 #ifdef DEBUG | 1106 #ifdef DEBUG |
1095 code->Print(); | 1107 OFStream os(stdout); |
| 1108 code->Print(os); |
1096 #endif | 1109 #endif |
1097 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1110 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1098 t.a = 1.5; | 1111 t.a = 1.5; |
1099 t.b = 2.75; | 1112 t.b = 2.75; |
1100 t.c = 17.17; | 1113 t.c = 17.17; |
1101 t.x = 1.5; | 1114 t.x = 1.5; |
1102 t.y = 2.75; | 1115 t.y = 2.75; |
1103 t.z = 17.17; | 1116 t.z = 17.17; |
1104 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1117 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
1105 USE(dummy); | 1118 USE(dummy); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 __ vdiv(d2, d0, d1); | 1170 __ vdiv(d2, d0, d1); |
1158 __ vstr(d2, r0, OFFSET_OF(T, div_result)); | 1171 __ vstr(d2, r0, OFFSET_OF(T, div_result)); |
1159 | 1172 |
1160 __ mov(pc, Operand(lr)); | 1173 __ mov(pc, Operand(lr)); |
1161 | 1174 |
1162 CodeDesc desc; | 1175 CodeDesc desc; |
1163 assm.GetCode(&desc); | 1176 assm.GetCode(&desc); |
1164 Handle<Code> code = isolate->factory()->NewCode( | 1177 Handle<Code> code = isolate->factory()->NewCode( |
1165 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1178 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1166 #ifdef DEBUG | 1179 #ifdef DEBUG |
1167 code->Print(); | 1180 OFStream os(stdout); |
| 1181 code->Print(os); |
1168 #endif | 1182 #endif |
1169 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1183 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1170 t.left = BitCast<double>(kHoleNanInt64); | 1184 t.left = BitCast<double>(kHoleNanInt64); |
1171 t.right = 1; | 1185 t.right = 1; |
1172 t.add_result = 0; | 1186 t.add_result = 0; |
1173 t.sub_result = 0; | 1187 t.sub_result = 0; |
1174 t.mul_result = 0; | 1188 t.mul_result = 0; |
1175 t.div_result = 0; | 1189 t.div_result = 0; |
1176 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1190 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
1177 USE(dummy); | 1191 USE(dummy); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 __ add(r4, r0, Operand(OFFSET_OF(T, dstA4))); | 1274 __ add(r4, r0, Operand(OFFSET_OF(T, dstA4))); |
1261 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); | 1275 __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); |
1262 | 1276 |
1263 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1277 __ ldm(ia_w, sp, r4.bit() | pc.bit()); |
1264 | 1278 |
1265 CodeDesc desc; | 1279 CodeDesc desc; |
1266 assm.GetCode(&desc); | 1280 assm.GetCode(&desc); |
1267 Handle<Code> code = isolate->factory()->NewCode( | 1281 Handle<Code> code = isolate->factory()->NewCode( |
1268 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1282 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1269 #ifdef DEBUG | 1283 #ifdef DEBUG |
1270 code->Print(); | 1284 OFStream os(stdout); |
| 1285 code->Print(os); |
1271 #endif | 1286 #endif |
1272 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1287 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1273 t.src0 = 0x01020304; | 1288 t.src0 = 0x01020304; |
1274 t.src1 = 0x11121314; | 1289 t.src1 = 0x11121314; |
1275 t.src2 = 0x21222324; | 1290 t.src2 = 0x21222324; |
1276 t.src3 = 0x31323334; | 1291 t.src3 = 0x31323334; |
1277 t.src4 = 0x41424344; | 1292 t.src4 = 0x41424344; |
1278 t.src5 = 0x51525354; | 1293 t.src5 = 0x51525354; |
1279 t.src6 = 0x61626364; | 1294 t.src6 = 0x61626364; |
1280 t.src7 = 0x71727374; | 1295 t.src7 = 0x71727374; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 __ uxtab(r2, r0, Operand(r1, ROR, 8)); | 1377 __ uxtab(r2, r0, Operand(r1, ROR, 8)); |
1363 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst4))); | 1378 __ str(r2, MemOperand(r4, OFFSET_OF(T, dst4))); |
1364 | 1379 |
1365 __ ldm(ia_w, sp, r4.bit() | pc.bit()); | 1380 __ ldm(ia_w, sp, r4.bit() | pc.bit()); |
1366 | 1381 |
1367 CodeDesc desc; | 1382 CodeDesc desc; |
1368 assm.GetCode(&desc); | 1383 assm.GetCode(&desc); |
1369 Handle<Code> code = isolate->factory()->NewCode( | 1384 Handle<Code> code = isolate->factory()->NewCode( |
1370 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1385 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1371 #ifdef DEBUG | 1386 #ifdef DEBUG |
1372 code->Print(); | 1387 OFStream os(stdout); |
| 1388 code->Print(os); |
1373 #endif | 1389 #endif |
1374 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1390 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1375 t.src0 = 0x01020304; | 1391 t.src0 = 0x01020304; |
1376 t.src1 = 0x11121314; | 1392 t.src1 = 0x11121314; |
1377 t.src2 = 0x11121300; | 1393 t.src2 = 0x11121300; |
1378 t.dst0 = 0; | 1394 t.dst0 = 0; |
1379 t.dst1 = 0; | 1395 t.dst1 = 0; |
1380 t.dst2 = 0; | 1396 t.dst2 = 0; |
1381 t.dst3 = 0; | 1397 t.dst3 = 0; |
1382 t.dst4 = 0; | 1398 t.dst4 = 0; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 __ sdiv(r2, r0, r1); | 1460 __ sdiv(r2, r0, r1); |
1445 __ str(r2, MemOperand(r3, OFFSET_OF(T, result))); | 1461 __ str(r2, MemOperand(r3, OFFSET_OF(T, result))); |
1446 | 1462 |
1447 __ bx(lr); | 1463 __ bx(lr); |
1448 | 1464 |
1449 CodeDesc desc; | 1465 CodeDesc desc; |
1450 assm.GetCode(&desc); | 1466 assm.GetCode(&desc); |
1451 Handle<Code> code = isolate->factory()->NewCode( | 1467 Handle<Code> code = isolate->factory()->NewCode( |
1452 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1468 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1453 #ifdef DEBUG | 1469 #ifdef DEBUG |
1454 code->Print(); | 1470 OFStream os(stdout); |
| 1471 code->Print(os); |
1455 #endif | 1472 #endif |
1456 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1473 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1457 Object* dummy; | 1474 Object* dummy; |
1458 TEST_SDIV(1073741824, kMinInt, -2); | 1475 TEST_SDIV(1073741824, kMinInt, -2); |
1459 TEST_SDIV(kMinInt, kMinInt, -1); | 1476 TEST_SDIV(kMinInt, kMinInt, -1); |
1460 TEST_SDIV(5, 10, 2); | 1477 TEST_SDIV(5, 10, 2); |
1461 TEST_SDIV(3, 10, 3); | 1478 TEST_SDIV(3, 10, 3); |
1462 TEST_SDIV(-5, 10, -2); | 1479 TEST_SDIV(-5, 10, -2); |
1463 TEST_SDIV(-3, 10, -3); | 1480 TEST_SDIV(-3, 10, -3); |
1464 TEST_SDIV(-5, -10, 2); | 1481 TEST_SDIV(-5, -10, 2); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 assm.GetCode(&desc); | 1554 assm.GetCode(&desc); |
1538 Handle<Code> code = isolate->factory()->NewCode( | 1555 Handle<Code> code = isolate->factory()->NewCode( |
1539 desc, Code::ComputeFlags(Code::STUB), code_object); | 1556 desc, Code::ComputeFlags(Code::STUB), code_object); |
1540 F1 f = FUNCTION_CAST<F1>(code->entry()); | 1557 F1 f = FUNCTION_CAST<F1>(code->entry()); |
1541 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 21, 0, 0, 0, 0)); | 1558 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 21, 0, 0, 0, 0)); |
1542 ::printf("f() = %d\n", res); | 1559 ::printf("f() = %d\n", res); |
1543 CHECK_EQ(42, res); | 1560 CHECK_EQ(42, res); |
1544 } | 1561 } |
1545 | 1562 |
1546 #undef __ | 1563 #undef __ |
OLD | NEW |