Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 119414: Cleanup of ARM exception handlers. Remove the unused code and... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/frames-arm.h ('k') | src/arm/virtual-frame-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 int r = JSCallerSavedCode(i); 550 int r = JSCallerSavedCode(i);
551 if ((regs & (1 << r)) != 0) { 551 if ((regs & (1 << r)) != 0) {
552 mov(ip, Operand(ExternalReference(Debug_Address::Register(i)))); 552 mov(ip, Operand(ExternalReference(Debug_Address::Register(i))));
553 ldr(scratch, MemOperand(base, 4, PostIndex)); 553 ldr(scratch, MemOperand(base, 4, PostIndex));
554 str(scratch, MemOperand(ip)); 554 str(scratch, MemOperand(ip));
555 } 555 }
556 } 556 }
557 } 557 }
558 #endif 558 #endif
559 559
560
560 void MacroAssembler::PushTryHandler(CodeLocation try_location, 561 void MacroAssembler::PushTryHandler(CodeLocation try_location,
561 HandlerType type) { 562 HandlerType type) {
562 ASSERT(StackHandlerConstants::kSize == 6 * kPointerSize); // adjust this code 563 // Adjust this code if not the case.
564 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize);
563 // The pc (return address) is passed in register lr. 565 // The pc (return address) is passed in register lr.
564 if (try_location == IN_JAVASCRIPT) { 566 if (try_location == IN_JAVASCRIPT) {
565 stm(db_w, sp, pp.bit() | fp.bit() | lr.bit());
566 if (type == TRY_CATCH_HANDLER) { 567 if (type == TRY_CATCH_HANDLER) {
567 mov(r3, Operand(StackHandler::TRY_CATCH)); 568 mov(r3, Operand(StackHandler::TRY_CATCH));
568 } else { 569 } else {
569 mov(r3, Operand(StackHandler::TRY_FINALLY)); 570 mov(r3, Operand(StackHandler::TRY_FINALLY));
570 } 571 }
571 push(r3); // state 572 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
573 && StackHandlerConstants::kFPOffset == 2 * kPointerSize
574 && StackHandlerConstants::kPCOffset == 3 * kPointerSize);
575 stm(db_w, sp, r3.bit() | fp.bit() | lr.bit());
576 // Save the current handler as the next handler.
572 mov(r3, Operand(ExternalReference(Top::k_handler_address))); 577 mov(r3, Operand(ExternalReference(Top::k_handler_address)));
573 ldr(r1, MemOperand(r3)); 578 ldr(r1, MemOperand(r3));
574 push(r1); // next sp 579 ASSERT(StackHandlerConstants::kNextOffset == 0);
575 str(sp, MemOperand(r3)); // chain handler 580 push(r1);
576 mov(r0, Operand(Smi::FromInt(StackHandler::kCodeNotPresent))); // new TOS 581 // Link this handler as the new current one.
577 push(r0); 582 str(sp, MemOperand(r3));
578 } else { 583 } else {
579 // Must preserve r0-r4, r5-r7 are available. 584 // Must preserve r0-r4, r5-r7 are available.
580 ASSERT(try_location == IN_JS_ENTRY); 585 ASSERT(try_location == IN_JS_ENTRY);
581 // The parameter pointer is meaningless here and fp does not point to a JS 586 // The frame pointer does not point to a JS frame so we save NULL
582 // frame. So we save NULL for both pp and fp. We expect the code throwing an 587 // for fp. We expect the code throwing an exception to check fp
583 // exception to check fp before dereferencing it to restore the context. 588 // before dereferencing it to restore the context.
584 mov(pp, Operand(0)); // set pp to NULL 589 mov(ip, Operand(0)); // To save a NULL frame pointer.
585 mov(ip, Operand(0)); // to save a NULL fp
586 stm(db_w, sp, pp.bit() | ip.bit() | lr.bit());
587 mov(r6, Operand(StackHandler::ENTRY)); 590 mov(r6, Operand(StackHandler::ENTRY));
588 push(r6); // state 591 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize
592 && StackHandlerConstants::kFPOffset == 2 * kPointerSize
593 && StackHandlerConstants::kPCOffset == 3 * kPointerSize);
594 stm(db_w, sp, r6.bit() | ip.bit() | lr.bit());
595 // Save the current handler as the next handler.
589 mov(r7, Operand(ExternalReference(Top::k_handler_address))); 596 mov(r7, Operand(ExternalReference(Top::k_handler_address)));
590 ldr(r6, MemOperand(r7)); 597 ldr(r6, MemOperand(r7));
591 push(r6); // next sp 598 ASSERT(StackHandlerConstants::kNextOffset == 0);
592 str(sp, MemOperand(r7)); // chain handler 599 push(r6);
593 mov(r5, Operand(Smi::FromInt(StackHandler::kCodeNotPresent))); // new TOS 600 // Link this handler as the new current one.
594 push(r5); // flush TOS 601 str(sp, MemOperand(r7));
595 } 602 }
596 } 603 }
597 604
598 605
599 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg, 606 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg,
600 JSObject* holder, Register holder_reg, 607 JSObject* holder, Register holder_reg,
601 Register scratch, 608 Register scratch,
602 Label* miss) { 609 Label* miss) {
603 // Make sure there's no overlap between scratch and the other 610 // Make sure there's no overlap between scratch and the other
604 // registers. 611 // registers.
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 #endif 941 #endif
935 mov(r0, Operand(p0)); 942 mov(r0, Operand(p0));
936 push(r0); 943 push(r0);
937 mov(r0, Operand(Smi::FromInt(p1 - p0))); 944 mov(r0, Operand(Smi::FromInt(p1 - p0)));
938 push(r0); 945 push(r0);
939 CallRuntime(Runtime::kAbort, 2); 946 CallRuntime(Runtime::kAbort, 2);
940 // will not return here 947 // will not return here
941 } 948 }
942 949
943 } } // namespace v8::internal 950 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/frames-arm.h ('k') | src/arm/virtual-frame-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698