| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 int64_t smi_value = smi_from_intptr->value(); | 135 int64_t smi_value = smi_from_intptr->value(); |
| 136 CHECK_EQ(number, smi_value); | 136 CHECK_EQ(number, smi_value); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } | 139 } |
| 140 | 140 |
| 141 | 141 |
| 142 static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi* value) { | 142 static void TestMoveSmi(MacroAssembler* masm, Label* exit, int id, Smi* value) { |
| 143 __ movl(rax, Immediate(id)); | 143 __ movl(rax, Immediate(id)); |
| 144 __ Move(rcx, Smi::FromInt(0)); | 144 __ Move(rcx, value); |
| 145 __ Set(rdx, reinterpret_cast<intptr_t>(Smi::FromInt(0))); | 145 __ Set(rdx, reinterpret_cast<intptr_t>(value)); |
| 146 __ cmpq(rcx, rdx); | 146 __ cmpq(rcx, rdx); |
| 147 __ j(not_equal, exit); | 147 __ j(not_equal, exit); |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 // Test that we can move a Smi value literally into a register. | 151 // Test that we can move a Smi value literally into a register. |
| 152 TEST(SmiMove) { | 152 TEST(SmiMove) { |
| 153 v8::internal::V8::Initialize(NULL); | 153 v8::internal::V8::Initialize(NULL); |
| 154 // Allocate an executable page of memory. | 154 // Allocate an executable page of memory. |
| 155 size_t actual_size; | 155 size_t actual_size; |
| (...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2629 CodeDesc desc; | 2629 CodeDesc desc; |
| 2630 masm->GetCode(&desc); | 2630 masm->GetCode(&desc); |
| 2631 // Call the function from C++. | 2631 // Call the function from C++. |
| 2632 int result = FUNCTION_CAST<F0>(buffer)(); | 2632 int result = FUNCTION_CAST<F0>(buffer)(); |
| 2633 CHECK_EQ(0, result); | 2633 CHECK_EQ(0, result); |
| 2634 } | 2634 } |
| 2635 | 2635 |
| 2636 | 2636 |
| 2637 | 2637 |
| 2638 #undef __ | 2638 #undef __ |
| OLD | NEW |