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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 push(ecx); | 441 push(ecx); |
442 | 442 |
443 // Clear the top frame. | 443 // Clear the top frame. |
444 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); | 444 ExternalReference c_entry_fp_address(Top::k_c_entry_fp_address); |
445 mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0)); | 445 mov(Operand::StaticVariable(c_entry_fp_address), Immediate(0)); |
446 } | 446 } |
447 | 447 |
448 | 448 |
449 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 449 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
450 HandlerType type) { | 450 HandlerType type) { |
451 ASSERT(StackHandlerConstants::kSize == 6 * kPointerSize); // adjust this code | 451 // Adjust this code if not the case. |
| 452 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
452 // The pc (return address) is already on TOS. | 453 // The pc (return address) is already on TOS. |
453 if (try_location == IN_JAVASCRIPT) { | 454 if (try_location == IN_JAVASCRIPT) { |
454 if (type == TRY_CATCH_HANDLER) { | 455 if (type == TRY_CATCH_HANDLER) { |
455 push(Immediate(StackHandler::TRY_CATCH)); | 456 push(Immediate(StackHandler::TRY_CATCH)); |
456 } else { | 457 } else { |
457 push(Immediate(StackHandler::TRY_FINALLY)); | 458 push(Immediate(StackHandler::TRY_FINALLY)); |
458 } | 459 } |
459 push(Immediate(Smi::FromInt(StackHandler::kCodeNotPresent))); | |
460 push(ebp); | 460 push(ebp); |
461 push(edi); | |
462 } else { | 461 } else { |
463 ASSERT(try_location == IN_JS_ENTRY); | 462 ASSERT(try_location == IN_JS_ENTRY); |
464 // The parameter pointer is meaningless here and ebp does not | 463 // The parameter pointer is meaningless here and ebp does not |
465 // point to a JS frame. So we save NULL for both pp and ebp. We | 464 // point to a JS frame. So we save NULL for both pp and ebp. We |
466 // expect the code throwing an exception to check ebp before | 465 // expect the code throwing an exception to check ebp before |
467 // dereferencing it to restore the context. | 466 // dereferencing it to restore the context. |
468 push(Immediate(StackHandler::ENTRY)); | 467 push(Immediate(StackHandler::ENTRY)); |
469 push(Immediate(Smi::FromInt(StackHandler::kCodeNotPresent))); | |
470 push(Immediate(0)); // NULL frame pointer | 468 push(Immediate(0)); // NULL frame pointer |
471 push(Immediate(0)); // NULL parameter pointer | |
472 } | 469 } |
473 // Cached TOS. | 470 // Cached TOS. |
474 mov(eax, Operand::StaticVariable(ExternalReference(Top::k_handler_address))); | 471 mov(eax, Operand::StaticVariable(ExternalReference(Top::k_handler_address))); |
475 // Link this handler. | 472 // Link this handler. |
476 mov(Operand::StaticVariable(ExternalReference(Top::k_handler_address)), esp); | 473 mov(Operand::StaticVariable(ExternalReference(Top::k_handler_address)), esp); |
477 } | 474 } |
478 | 475 |
479 | 476 |
480 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg, | 477 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg, |
481 JSObject* holder, Register holder_reg, | 478 JSObject* holder, Register holder_reg, |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 // Indicate that code has changed. | 1040 // Indicate that code has changed. |
1044 CPU::FlushICache(address_, size_); | 1041 CPU::FlushICache(address_, size_); |
1045 | 1042 |
1046 // Check that the code was patched as expected. | 1043 // Check that the code was patched as expected. |
1047 ASSERT(masm_.pc_ == address_ + size_); | 1044 ASSERT(masm_.pc_ == address_ + size_); |
1048 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1045 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1049 } | 1046 } |
1050 | 1047 |
1051 | 1048 |
1052 } } // namespace v8::internal | 1049 } } // namespace v8::internal |
OLD | NEW |