OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // patch with the code required by the debugger. | 427 // patch with the code required by the debugger. |
428 __ movp(rsp, rbp); | 428 __ movp(rsp, rbp); |
429 __ popq(rbp); | 429 __ popq(rbp); |
430 int no_frame_start = masm_->pc_offset(); | 430 int no_frame_start = masm_->pc_offset(); |
431 | 431 |
432 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; | 432 int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize; |
433 __ Ret(arguments_bytes, rcx); | 433 __ Ret(arguments_bytes, rcx); |
434 | 434 |
435 #ifdef ENABLE_DEBUGGER_SUPPORT | 435 #ifdef ENABLE_DEBUGGER_SUPPORT |
436 // Add padding that will be overwritten by a debugger breakpoint. We | 436 // Add padding that will be overwritten by a debugger breakpoint. We |
437 // have just generated at least 7 bytes: "movq rsp, rbp; pop rbp; ret k" | 437 // have just generated at least 7 bytes: "movp rsp, rbp; pop rbp; ret k" |
438 // (3 + 1 + 3). | 438 // (3 + 1 + 3) for x64 and at least 6 (2 + 1 + 3) bytes for x32. |
439 const int kPadding = Assembler::kJSReturnSequenceLength - 7; | 439 const int kPadding = Assembler::kJSReturnSequenceLength - |
| 440 kPointerSize == kInt64Size ? 7 : 6; |
440 for (int i = 0; i < kPadding; ++i) { | 441 for (int i = 0; i < kPadding; ++i) { |
441 masm_->int3(); | 442 masm_->int3(); |
442 } | 443 } |
443 // Check that the size of the code used for returning is large enough | 444 // Check that the size of the code used for returning is large enough |
444 // for the debugger's requirements. | 445 // for the debugger's requirements. |
445 ASSERT(Assembler::kJSReturnSequenceLength <= | 446 ASSERT(Assembler::kJSReturnSequenceLength <= |
446 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); | 447 masm_->SizeOfCodeGeneratedSince(&check_exit_codesize)); |
447 #endif | 448 #endif |
448 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 449 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
449 } | 450 } |
(...skipping 4402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4852 *stack_depth = 0; | 4853 *stack_depth = 0; |
4853 *context_length = 0; | 4854 *context_length = 0; |
4854 return previous_; | 4855 return previous_; |
4855 } | 4856 } |
4856 | 4857 |
4857 | 4858 |
4858 #undef __ | 4859 #undef __ |
4859 | 4860 |
4860 | 4861 |
4861 static const byte kJnsInstruction = 0x79; | 4862 static const byte kJnsInstruction = 0x79; |
4862 static const byte kJnsOffset = 0x1d; | 4863 static const byte kJnsOffset = kPointerSize == kInt64Size ? 0x1d : 0x14; |
4863 static const byte kNopByteOne = 0x66; | 4864 static const byte kNopByteOne = 0x66; |
4864 static const byte kNopByteTwo = 0x90; | 4865 static const byte kNopByteTwo = 0x90; |
4865 #ifdef DEBUG | 4866 #ifdef DEBUG |
4866 static const byte kCallInstruction = 0xe8; | 4867 static const byte kCallInstruction = 0xe8; |
4867 #endif | 4868 #endif |
4868 | 4869 |
4869 | 4870 |
4870 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 4871 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
4871 Address pc, | 4872 Address pc, |
4872 BackEdgeState target_state, | 4873 BackEdgeState target_state, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4933 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4933 Assembler::target_address_at(call_target_address, | 4934 Assembler::target_address_at(call_target_address, |
4934 unoptimized_code)); | 4935 unoptimized_code)); |
4935 return OSR_AFTER_STACK_CHECK; | 4936 return OSR_AFTER_STACK_CHECK; |
4936 } | 4937 } |
4937 | 4938 |
4938 | 4939 |
4939 } } // namespace v8::internal | 4940 } } // namespace v8::internal |
4940 | 4941 |
4941 #endif // V8_TARGET_ARCH_X64 | 4942 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |