| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #endif | 100 #endif |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 | 103 |
| 104 static void EmitStackCheck(MacroAssembler* masm_, | 104 static void EmitStackCheck(MacroAssembler* masm_, |
| 105 int pointers = 0, | 105 int pointers = 0, |
| 106 Register scratch = rsp) { | 106 Register scratch = rsp) { |
| 107 Isolate* isolate = masm_->isolate(); | 107 Isolate* isolate = masm_->isolate(); |
| 108 Label ok; | 108 Label ok; |
| 109 ASSERT(scratch.is(rsp) == (pointers == 0)); | 109 ASSERT(scratch.is(rsp) == (pointers == 0)); |
| 110 Heap::RootListIndex index; |
| 110 if (pointers != 0) { | 111 if (pointers != 0) { |
| 111 __ movp(scratch, rsp); | 112 __ movp(scratch, rsp); |
| 112 __ subp(scratch, Immediate(pointers * kPointerSize)); | 113 __ subp(scratch, Immediate(pointers * kPointerSize)); |
| 114 index = Heap::kRealStackLimitRootIndex; |
| 115 } else { |
| 116 index = Heap::kStackLimitRootIndex; |
| 113 } | 117 } |
| 114 __ CompareRoot(scratch, Heap::kStackLimitRootIndex); | 118 __ CompareRoot(scratch, index); |
| 115 __ j(above_equal, &ok, Label::kNear); | 119 __ j(above_equal, &ok, Label::kNear); |
| 116 __ call(isolate->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 120 __ call(isolate->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
| 117 __ bind(&ok); | 121 __ bind(&ok); |
| 118 } | 122 } |
| 119 | 123 |
| 120 | 124 |
| 121 // Generate code for a JS function. On entry to the function the receiver | 125 // Generate code for a JS function. On entry to the function the receiver |
| 122 // and arguments have been pushed on the stack left to right, with the | 126 // and arguments have been pushed on the stack left to right, with the |
| 123 // return address on top of them. The actual argument count matches the | 127 // return address on top of them. The actual argument count matches the |
| 124 // formal parameter count expected by the function. | 128 // formal parameter count expected by the function. |
| (...skipping 4787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4912 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4916 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4913 Assembler::target_address_at(call_target_address, | 4917 Assembler::target_address_at(call_target_address, |
| 4914 unoptimized_code)); | 4918 unoptimized_code)); |
| 4915 return OSR_AFTER_STACK_CHECK; | 4919 return OSR_AFTER_STACK_CHECK; |
| 4916 } | 4920 } |
| 4917 | 4921 |
| 4918 | 4922 |
| 4919 } } // namespace v8::internal | 4923 } } // namespace v8::internal |
| 4920 | 4924 |
| 4921 #endif // V8_TARGET_ARCH_X64 | 4925 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |