| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 str(cp, MemOperand(ip)); | 313 str(cp, MemOperand(ip)); |
| 314 | 314 |
| 315 // Setup argc and the builtin function in callee-saved registers. | 315 // Setup argc and the builtin function in callee-saved registers. |
| 316 mov(r4, Operand(r0)); | 316 mov(r4, Operand(r0)); |
| 317 mov(r5, Operand(r1)); | 317 mov(r5, Operand(r1)); |
| 318 | 318 |
| 319 // Compute the argv pointer and keep it in a callee-saved register. | 319 // Compute the argv pointer and keep it in a callee-saved register. |
| 320 add(r6, fp, Operand(r4, LSL, kPointerSizeLog2)); | 320 add(r6, fp, Operand(r4, LSL, kPointerSizeLog2)); |
| 321 add(r6, r6, Operand(ExitFrameConstants::kPPDisplacement - kPointerSize)); | 321 add(r6, r6, Operand(ExitFrameConstants::kPPDisplacement - kPointerSize)); |
| 322 | 322 |
| 323 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 323 // Save the state of all registers to the stack from the memory | 324 // Save the state of all registers to the stack from the memory |
| 324 // location. This is needed to allow nested break points. | 325 // location. This is needed to allow nested break points. |
| 325 if (type == StackFrame::EXIT_DEBUG) { | 326 if (type == StackFrame::EXIT_DEBUG) { |
| 326 // Use sp as base to push. | 327 // Use sp as base to push. |
| 327 CopyRegistersFromMemoryToStack(sp, kJSCallerSaved); | 328 CopyRegistersFromMemoryToStack(sp, kJSCallerSaved); |
| 328 } | 329 } |
| 330 #endif |
| 329 } | 331 } |
| 330 | 332 |
| 331 | 333 |
| 332 void MacroAssembler::LeaveExitFrame(StackFrame::Type type) { | 334 void MacroAssembler::LeaveExitFrame(StackFrame::Type type) { |
| 335 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 333 // Restore the memory copy of the registers by digging them out from | 336 // Restore the memory copy of the registers by digging them out from |
| 334 // the stack. This is needed to allow nested break points. | 337 // the stack. This is needed to allow nested break points. |
| 335 if (type == StackFrame::EXIT_DEBUG) { | 338 if (type == StackFrame::EXIT_DEBUG) { |
| 336 // This code intentionally clobbers r2 and r3. | 339 // This code intentionally clobbers r2 and r3. |
| 337 const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize; | 340 const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize; |
| 338 const int kOffset = ExitFrameConstants::kDebugMarkOffset - kCallerSavedSize; | 341 const int kOffset = ExitFrameConstants::kDebugMarkOffset - kCallerSavedSize; |
| 339 add(r3, fp, Operand(kOffset)); | 342 add(r3, fp, Operand(kOffset)); |
| 340 CopyRegistersFromStackToMemory(r3, r2, kJSCallerSaved); | 343 CopyRegistersFromStackToMemory(r3, r2, kJSCallerSaved); |
| 341 } | 344 } |
| 345 #endif |
| 342 | 346 |
| 343 // Clear top frame. | 347 // Clear top frame. |
| 344 mov(r3, Operand(0)); | 348 mov(r3, Operand(0)); |
| 345 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 349 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); |
| 346 str(r3, MemOperand(ip)); | 350 str(r3, MemOperand(ip)); |
| 347 | 351 |
| 348 // Restore current context from top and clear it in debug mode. | 352 // Restore current context from top and clear it in debug mode. |
| 349 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 353 mov(ip, Operand(ExternalReference(Top::k_context_address))); |
| 350 ldr(cp, MemOperand(ip)); | 354 ldr(cp, MemOperand(ip)); |
| 351 if (kDebug) { | 355 if (kDebug) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 SharedFunctionInfo::kFormalParameterCountOffset)); | 488 SharedFunctionInfo::kFormalParameterCountOffset)); |
| 485 ldr(code_reg, | 489 ldr(code_reg, |
| 486 MemOperand(code_reg, SharedFunctionInfo::kCodeOffset - kHeapObjectTag)); | 490 MemOperand(code_reg, SharedFunctionInfo::kCodeOffset - kHeapObjectTag)); |
| 487 add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 491 add(code_reg, code_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 488 | 492 |
| 489 ParameterCount expected(expected_reg); | 493 ParameterCount expected(expected_reg); |
| 490 InvokeCode(code_reg, expected, actual, flag); | 494 InvokeCode(code_reg, expected, actual, flag); |
| 491 } | 495 } |
| 492 | 496 |
| 493 | 497 |
| 498 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 494 void MacroAssembler::SaveRegistersToMemory(RegList regs) { | 499 void MacroAssembler::SaveRegistersToMemory(RegList regs) { |
| 495 ASSERT((regs & ~kJSCallerSaved) == 0); | 500 ASSERT((regs & ~kJSCallerSaved) == 0); |
| 496 // Copy the content of registers to memory location. | 501 // Copy the content of registers to memory location. |
| 497 for (int i = 0; i < kNumJSCallerSaved; i++) { | 502 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 498 int r = JSCallerSavedCode(i); | 503 int r = JSCallerSavedCode(i); |
| 499 if ((regs & (1 << r)) != 0) { | 504 if ((regs & (1 << r)) != 0) { |
| 500 Register reg = { r }; | 505 Register reg = { r }; |
| 501 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); | 506 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); |
| 502 str(reg, MemOperand(ip)); | 507 str(reg, MemOperand(ip)); |
| 503 } | 508 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 // Copy the content of the stack to the memory location and adjust base. | 546 // Copy the content of the stack to the memory location and adjust base. |
| 542 for (int i = 0; i < kNumJSCallerSaved; i++) { | 547 for (int i = 0; i < kNumJSCallerSaved; i++) { |
| 543 int r = JSCallerSavedCode(i); | 548 int r = JSCallerSavedCode(i); |
| 544 if ((regs & (1 << r)) != 0) { | 549 if ((regs & (1 << r)) != 0) { |
| 545 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); | 550 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); |
| 546 ldr(scratch, MemOperand(base, 4, PostIndex)); | 551 ldr(scratch, MemOperand(base, 4, PostIndex)); |
| 547 str(scratch, MemOperand(ip)); | 552 str(scratch, MemOperand(ip)); |
| 548 } | 553 } |
| 549 } | 554 } |
| 550 } | 555 } |
| 551 | 556 #endif |
| 552 | 557 |
| 553 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 558 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
| 554 HandlerType type) { | 559 HandlerType type) { |
| 555 ASSERT(StackHandlerConstants::kSize == 6 * kPointerSize); // adjust this code | 560 ASSERT(StackHandlerConstants::kSize == 6 * kPointerSize); // adjust this code |
| 556 // The pc (return address) is passed in register lr. | 561 // The pc (return address) is passed in register lr. |
| 557 if (try_location == IN_JAVASCRIPT) { | 562 if (try_location == IN_JAVASCRIPT) { |
| 558 stm(db_w, sp, pp.bit() | fp.bit() | lr.bit()); | 563 stm(db_w, sp, pp.bit() | fp.bit() | lr.bit()); |
| 559 if (type == TRY_CATCH_HANDLER) { | 564 if (type == TRY_CATCH_HANDLER) { |
| 560 mov(r3, Operand(StackHandler::TRY_CATCH)); | 565 mov(r3, Operand(StackHandler::TRY_CATCH)); |
| 561 } else { | 566 } else { |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 #endif | 932 #endif |
| 928 mov(r0, Operand(p0)); | 933 mov(r0, Operand(p0)); |
| 929 push(r0); | 934 push(r0); |
| 930 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 935 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
| 931 push(r0); | 936 push(r0); |
| 932 CallRuntime(Runtime::kAbort, 2); | 937 CallRuntime(Runtime::kAbort, 2); |
| 933 // will not return here | 938 // will not return here |
| 934 } | 939 } |
| 935 | 940 |
| 936 } } // namespace v8::internal | 941 } } // namespace v8::internal |
| OLD | NEW |