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 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 set_register(r11, r11_val); | 1917 set_register(r11, r11_val); |
1918 | 1918 |
1919 // Pop stack passed arguments. | 1919 // Pop stack passed arguments. |
1920 CHECK_EQ(entry_stack, get_register(sp)); | 1920 CHECK_EQ(entry_stack, get_register(sp)); |
1921 set_register(sp, original_stack); | 1921 set_register(sp, original_stack); |
1922 | 1922 |
1923 int32_t result = get_register(r0); | 1923 int32_t result = get_register(r0); |
1924 return result; | 1924 return result; |
1925 } | 1925 } |
1926 | 1926 |
| 1927 |
| 1928 uintptr_t Simulator::PushAddress(uintptr_t address) { |
| 1929 int new_sp = get_register(sp) - sizeof(uintptr_t); |
| 1930 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(new_sp); |
| 1931 *stack_slot = address; |
| 1932 set_register(sp, new_sp); |
| 1933 return new_sp; |
| 1934 } |
| 1935 |
| 1936 |
| 1937 uintptr_t Simulator::PopAddress() { |
| 1938 int current_sp = get_register(sp); |
| 1939 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); |
| 1940 uintptr_t address = *stack_slot; |
| 1941 set_register(sp, current_sp + sizeof(uintptr_t)); |
| 1942 return address; |
| 1943 } |
| 1944 |
| 1945 |
1927 } } // namespace assembler::arm | 1946 } } // namespace assembler::arm |
1928 | 1947 |
1929 #endif // !defined(__arm__) | 1948 #endif // !defined(__arm__) |
OLD | NEW |