| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 477 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 478 pop(Operand::StaticVariable(handler_address)); | 478 pop(Operand::StaticVariable(handler_address)); |
| 479 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize); | 479 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize); |
| 480 pop(ebp); | 480 pop(ebp); |
| 481 pop(edx); // Remove state. | 481 pop(edx); // Remove state. |
| 482 | 482 |
| 483 // Before returning we restore the context from the frame pointer if | 483 // Before returning we restore the context from the frame pointer if |
| 484 // not NULL. The frame pointer is NULL in the exception handler of | 484 // not NULL. The frame pointer is NULL in the exception handler of |
| 485 // a JS entry frame. | 485 // a JS entry frame. |
| 486 Set(esi, Immediate(0)); // Tentatively set context pointer to NULL. | 486 Set(esi, Immediate(0)); // Tentatively set context pointer to NULL. |
| 487 NearLabel skip; | 487 Label skip; |
| 488 cmp(ebp, 0); | 488 cmp(ebp, 0); |
| 489 j(equal, &skip, not_taken); | 489 j(equal, &skip, not_taken, Label::kNear); |
| 490 mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 490 mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 491 bind(&skip); | 491 bind(&skip); |
| 492 | 492 |
| 493 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize); | 493 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize); |
| 494 ret(0); | 494 ret(0); |
| 495 } | 495 } |
| 496 | 496 |
| 497 | 497 |
| 498 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, | 498 void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type, |
| 499 Register value) { | 499 Register value) { |
| 500 // Adjust this code if not the case. | 500 // Adjust this code if not the case. |
| 501 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 501 STATIC_ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
| 502 | 502 |
| 503 // eax must hold the exception. | 503 // eax must hold the exception. |
| 504 if (!value.is(eax)) { | 504 if (!value.is(eax)) { |
| 505 mov(eax, value); | 505 mov(eax, value); |
| 506 } | 506 } |
| 507 | 507 |
| 508 // Drop sp to the top stack handler. | 508 // Drop sp to the top stack handler. |
| 509 ExternalReference handler_address(Isolate::k_handler_address, | 509 ExternalReference handler_address(Isolate::k_handler_address, |
| 510 isolate()); | 510 isolate()); |
| 511 mov(esp, Operand::StaticVariable(handler_address)); | 511 mov(esp, Operand::StaticVariable(handler_address)); |
| 512 | 512 |
| 513 // Unwind the handlers until the ENTRY handler is found. | 513 // Unwind the handlers until the ENTRY handler is found. |
| 514 NearLabel loop, done; | 514 Label loop, done; |
| 515 bind(&loop); | 515 bind(&loop); |
| 516 // Load the type of the current stack handler. | 516 // Load the type of the current stack handler. |
| 517 const int kStateOffset = StackHandlerConstants::kStateOffset; | 517 const int kStateOffset = StackHandlerConstants::kStateOffset; |
| 518 cmp(Operand(esp, kStateOffset), Immediate(StackHandler::ENTRY)); | 518 cmp(Operand(esp, kStateOffset), Immediate(StackHandler::ENTRY)); |
| 519 j(equal, &done); | 519 j(equal, &done, Label::kNear); |
| 520 // Fetch the next handler in the list. | 520 // Fetch the next handler in the list. |
| 521 const int kNextOffset = StackHandlerConstants::kNextOffset; | 521 const int kNextOffset = StackHandlerConstants::kNextOffset; |
| 522 mov(esp, Operand(esp, kNextOffset)); | 522 mov(esp, Operand(esp, kNextOffset)); |
| 523 jmp(&loop); | 523 jmp(&loop); |
| 524 bind(&done); | 524 bind(&done); |
| 525 | 525 |
| 526 // Set the top handler address to next handler past the current ENTRY handler. | 526 // Set the top handler address to next handler past the current ENTRY handler. |
| 527 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); | 527 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); |
| 528 pop(Operand::StaticVariable(handler_address)); | 528 pop(Operand::StaticVariable(handler_address)); |
| 529 | 529 |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 | 2036 |
| 2037 // Check that the code was patched as expected. | 2037 // Check that the code was patched as expected. |
| 2038 ASSERT(masm_.pc_ == address_ + size_); | 2038 ASSERT(masm_.pc_ == address_ + size_); |
| 2039 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2039 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2040 } | 2040 } |
| 2041 | 2041 |
| 2042 | 2042 |
| 2043 } } // namespace v8::internal | 2043 } } // namespace v8::internal |
| 2044 | 2044 |
| 2045 #endif // V8_TARGET_ARCH_IA32 | 2045 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |