| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 typedef int (*F0)(); | 90 typedef int (*F0)(); |
| 91 | 91 |
| 92 #define __ masm-> | 92 #define __ masm-> |
| 93 | 93 |
| 94 | 94 |
| 95 static void EntryCode(MacroAssembler* masm) { | 95 static void EntryCode(MacroAssembler* masm) { |
| 96 // Smi constant register is callee save. | 96 // Smi constant register is callee save. |
| 97 __ push(v8::internal::kSmiConstantRegister); | 97 __ push(v8::internal::kSmiConstantRegister); |
| 98 __ InitializeSmiConstantRegister(); | 98 __ InitializeSmiConstantRegister(); |
| 99 __ InitializeRootRegister(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 | 102 |
| 102 static void ExitCode(MacroAssembler* masm) { | 103 static void ExitCode(MacroAssembler* masm) { |
| 103 // Return -1 if kSmiConstantRegister was clobbered during the test. | 104 // Return -1 if kSmiConstantRegister was clobbered during the test. |
| 104 __ Move(rdx, Smi::FromInt(1)); | 105 __ Move(rdx, Smi::FromInt(1)); |
| 105 __ cmpq(rdx, v8::internal::kSmiConstantRegister); | 106 __ cmpq(rdx, v8::internal::kSmiConstantRegister); |
| 106 __ movq(rdx, Immediate(-1)); | 107 __ movq(rdx, Immediate(-1)); |
| 107 __ cmovq(not_equal, rax, rdx); | 108 __ cmovq(not_equal, rax, rdx); |
| 108 __ pop(v8::internal::kSmiConstantRegister); | 109 __ pop(v8::internal::kSmiConstantRegister); |
| (...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2487 CodeDesc desc; | 2488 CodeDesc desc; |
| 2488 masm->GetCode(&desc); | 2489 masm->GetCode(&desc); |
| 2489 // Call the function from C++. | 2490 // Call the function from C++. |
| 2490 int result = FUNCTION_CAST<F0>(buffer)(); | 2491 int result = FUNCTION_CAST<F0>(buffer)(); |
| 2491 CHECK_EQ(0, result); | 2492 CHECK_EQ(0, result); |
| 2492 } | 2493 } |
| 2493 | 2494 |
| 2494 | 2495 |
| 2495 | 2496 |
| 2496 #undef __ | 2497 #undef __ |
| OLD | NEW |