| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdarg.h> | 5 #include <stdarg.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 } | 444 } |
| 445 | 445 |
| 446 while (cur < end) { | 446 while (cur < end) { |
| 447 prev = cur; | 447 prev = cur; |
| 448 cur += dasm.InstructionDecode(buffer, cur); | 448 cur += dasm.InstructionDecode(buffer, cur); |
| 449 PrintF(" 0x%08x %s\n", | 449 PrintF(" 0x%08x %s\n", |
| 450 reinterpret_cast<intptr_t>(prev), buffer.start()); | 450 reinterpret_cast<intptr_t>(prev), buffer.start()); |
| 451 } | 451 } |
| 452 } else if (strcmp(cmd, "gdb") == 0) { | 452 } else if (strcmp(cmd, "gdb") == 0) { |
| 453 PrintF("relinquishing control to gdb\n"); | 453 PrintF("relinquishing control to gdb\n"); |
| 454 v8::internal::OS::DebugBreak(); | 454 v8::base::OS::DebugBreak(); |
| 455 PrintF("regaining control from gdb\n"); | 455 PrintF("regaining control from gdb\n"); |
| 456 } else if (strcmp(cmd, "break") == 0) { | 456 } else if (strcmp(cmd, "break") == 0) { |
| 457 if (argc == 2) { | 457 if (argc == 2) { |
| 458 int32_t value; | 458 int32_t value; |
| 459 if (GetValue(arg1, &value)) { | 459 if (GetValue(arg1, &value)) { |
| 460 if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) { | 460 if (!SetBreakpoint(reinterpret_cast<Instruction*>(value))) { |
| 461 PrintF("setting breakpoint failed\n"); | 461 PrintF("setting breakpoint failed\n"); |
| 462 } | 462 } |
| 463 } else { | 463 } else { |
| 464 PrintF("%s unrecognized\n", arg1); | 464 PrintF("%s unrecognized\n", arg1); |
| (...skipping 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3756 ASSERT(argument_count >= 4); | 3756 ASSERT(argument_count >= 4); |
| 3757 set_register(r0, va_arg(parameters, int32_t)); | 3757 set_register(r0, va_arg(parameters, int32_t)); |
| 3758 set_register(r1, va_arg(parameters, int32_t)); | 3758 set_register(r1, va_arg(parameters, int32_t)); |
| 3759 set_register(r2, va_arg(parameters, int32_t)); | 3759 set_register(r2, va_arg(parameters, int32_t)); |
| 3760 set_register(r3, va_arg(parameters, int32_t)); | 3760 set_register(r3, va_arg(parameters, int32_t)); |
| 3761 | 3761 |
| 3762 // Remaining arguments passed on stack. | 3762 // Remaining arguments passed on stack. |
| 3763 int original_stack = get_register(sp); | 3763 int original_stack = get_register(sp); |
| 3764 // Compute position of stack on entry to generated code. | 3764 // Compute position of stack on entry to generated code. |
| 3765 int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t)); | 3765 int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t)); |
| 3766 if (OS::ActivationFrameAlignment() != 0) { | 3766 if (base::OS::ActivationFrameAlignment() != 0) { |
| 3767 entry_stack &= -OS::ActivationFrameAlignment(); | 3767 entry_stack &= -base::OS::ActivationFrameAlignment(); |
| 3768 } | 3768 } |
| 3769 // Store remaining arguments on stack, from low to high memory. | 3769 // Store remaining arguments on stack, from low to high memory. |
| 3770 intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack); | 3770 intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack); |
| 3771 for (int i = 4; i < argument_count; i++) { | 3771 for (int i = 4; i < argument_count; i++) { |
| 3772 stack_argument[i - 4] = va_arg(parameters, int32_t); | 3772 stack_argument[i - 4] = va_arg(parameters, int32_t); |
| 3773 } | 3773 } |
| 3774 va_end(parameters); | 3774 va_end(parameters); |
| 3775 set_register(sp, entry_stack); | 3775 set_register(sp, entry_stack); |
| 3776 | 3776 |
| 3777 CallInternal(entry); | 3777 CallInternal(entry); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3829 uintptr_t address = *stack_slot; | 3829 uintptr_t address = *stack_slot; |
| 3830 set_register(sp, current_sp + sizeof(uintptr_t)); | 3830 set_register(sp, current_sp + sizeof(uintptr_t)); |
| 3831 return address; | 3831 return address; |
| 3832 } | 3832 } |
| 3833 | 3833 |
| 3834 } } // namespace v8::internal | 3834 } } // namespace v8::internal |
| 3835 | 3835 |
| 3836 #endif // USE_SIMULATOR | 3836 #endif // USE_SIMULATOR |
| 3837 | 3837 |
| 3838 #endif // V8_TARGET_ARCH_ARM | 3838 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |