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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 397 |
398 void TestI64PlusConstantToSmi(MacroAssembler* masm, | 398 void TestI64PlusConstantToSmi(MacroAssembler* masm, |
399 Label* exit, | 399 Label* exit, |
400 int id, | 400 int id, |
401 int64_t x, | 401 int64_t x, |
402 int y) { | 402 int y) { |
403 int64_t result = x + y; | 403 int64_t result = x + y; |
404 ASSERT(Smi::IsValid(result)); | 404 ASSERT(Smi::IsValid(result)); |
405 __ movl(rax, Immediate(id)); | 405 __ movl(rax, Immediate(id)); |
406 __ Move(r8, Smi::FromInt(static_cast<int>(result))); | 406 __ Move(r8, Smi::FromInt(static_cast<int>(result))); |
407 __ movq(rcx, x, RelocInfo::NONE); | 407 __ movq(rcx, x, RelocInfo::NONE64); |
408 __ movq(r11, rcx); | 408 __ movq(r11, rcx); |
409 __ Integer64PlusConstantToSmi(rdx, rcx, y); | 409 __ Integer64PlusConstantToSmi(rdx, rcx, y); |
410 __ cmpq(rdx, r8); | 410 __ cmpq(rdx, r8); |
411 __ j(not_equal, exit); | 411 __ j(not_equal, exit); |
412 | 412 |
413 __ incq(rax); | 413 __ incq(rax); |
414 __ cmpq(r11, rcx); | 414 __ cmpq(r11, rcx); |
415 __ j(not_equal, exit); | 415 __ j(not_equal, exit); |
416 | 416 |
417 __ incq(rax); | 417 __ incq(rax); |
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2220 __ push(Immediate(0x108)); | 2220 __ push(Immediate(0x108)); |
2221 __ push(Immediate(0x109)); // <-- rsp | 2221 __ push(Immediate(0x109)); // <-- rsp |
2222 // rbp = rsp[9] | 2222 // rbp = rsp[9] |
2223 // r15 = rsp[3] | 2223 // r15 = rsp[3] |
2224 // rbx = rsp[5] | 2224 // rbx = rsp[5] |
2225 // r13 = rsp[7] | 2225 // r13 = rsp[7] |
2226 __ lea(r14, Operand(rsp, 3 * kPointerSize)); | 2226 __ lea(r14, Operand(rsp, 3 * kPointerSize)); |
2227 __ lea(r13, Operand(rbp, -3 * kPointerSize)); | 2227 __ lea(r13, Operand(rbp, -3 * kPointerSize)); |
2228 __ lea(rbx, Operand(rbp, -5 * kPointerSize)); | 2228 __ lea(rbx, Operand(rbp, -5 * kPointerSize)); |
2229 __ movl(rcx, Immediate(2)); | 2229 __ movl(rcx, Immediate(2)); |
2230 __ movq(r8, reinterpret_cast<uintptr_t>(&data[128]), RelocInfo::NONE); | 2230 __ movq(r8, reinterpret_cast<uintptr_t>(&data[128]), RelocInfo::NONE64); |
2231 __ movl(rax, Immediate(1)); | 2231 __ movl(rax, Immediate(1)); |
2232 | 2232 |
2233 Operand sp0 = Operand(rsp, 0); | 2233 Operand sp0 = Operand(rsp, 0); |
2234 | 2234 |
2235 // Test 1. | 2235 // Test 1. |
2236 __ movl(rdx, sp0); // Sanity check. | 2236 __ movl(rdx, sp0); // Sanity check. |
2237 __ cmpl(rdx, Immediate(0x109)); | 2237 __ cmpl(rdx, Immediate(0x109)); |
2238 __ j(not_equal, &exit); | 2238 __ j(not_equal, &exit); |
2239 __ incq(rax); | 2239 __ incq(rax); |
2240 | 2240 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2535 CodeDesc desc; | 2535 CodeDesc desc; |
2536 masm->GetCode(&desc); | 2536 masm->GetCode(&desc); |
2537 // Call the function from C++. | 2537 // Call the function from C++. |
2538 int result = FUNCTION_CAST<F0>(buffer)(); | 2538 int result = FUNCTION_CAST<F0>(buffer)(); |
2539 CHECK_EQ(0, result); | 2539 CHECK_EQ(0, result); |
2540 } | 2540 } |
2541 | 2541 |
2542 | 2542 |
2543 | 2543 |
2544 #undef __ | 2544 #undef __ |
OLD | NEW |