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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool info_emitted_; | 99 bool info_emitted_; |
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 = esp) { | 106 Register scratch = esp) { |
107 Label ok; | 107 Label ok; |
108 Isolate* isolate = masm_->isolate(); | 108 Isolate* isolate = masm_->isolate(); |
109 ExternalReference stack_limit = | |
110 ExternalReference::address_of_stack_limit(isolate); | |
111 ASSERT(scratch.is(esp) == (pointers == 0)); | 109 ASSERT(scratch.is(esp) == (pointers == 0)); |
| 110 ExternalReference stack_limit; |
112 if (pointers != 0) { | 111 if (pointers != 0) { |
113 __ mov(scratch, esp); | 112 __ mov(scratch, esp); |
114 __ sub(scratch, Immediate(pointers * kPointerSize)); | 113 __ sub(scratch, Immediate(pointers * kPointerSize)); |
| 114 stack_limit = ExternalReference::address_of_real_stack_limit(isolate); |
| 115 } else { |
| 116 stack_limit = ExternalReference::address_of_stack_limit(isolate); |
115 } | 117 } |
116 __ cmp(scratch, Operand::StaticVariable(stack_limit)); | 118 __ cmp(scratch, Operand::StaticVariable(stack_limit)); |
117 __ j(above_equal, &ok, Label::kNear); | 119 __ j(above_equal, &ok, Label::kNear); |
118 __ call(isolate->builtins()->StackCheck(), RelocInfo::CODE_TARGET); | 120 __ call(isolate->builtins()->StackCheck(), RelocInfo::CODE_TARGET); |
119 __ bind(&ok); | 121 __ bind(&ok); |
120 } | 122 } |
121 | 123 |
122 | 124 |
123 // 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 |
124 // 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 |
(...skipping 4791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4916 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4918 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4917 Assembler::target_address_at(call_target_address, | 4919 Assembler::target_address_at(call_target_address, |
4918 unoptimized_code)); | 4920 unoptimized_code)); |
4919 return OSR_AFTER_STACK_CHECK; | 4921 return OSR_AFTER_STACK_CHECK; |
4920 } | 4922 } |
4921 | 4923 |
4922 | 4924 |
4923 } } // namespace v8::internal | 4925 } } // namespace v8::internal |
4924 | 4926 |
4925 #endif // V8_TARGET_ARCH_IA32 | 4927 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |