OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/codegen.h" | 5 #include "src/codegen.h" |
6 #include "src/deoptimizer.h" | 6 #include "src/deoptimizer.h" |
7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/register-configuration.h" | 8 #include "src/register-configuration.h" |
9 #include "src/safepoint-table.h" | 9 #include "src/safepoint-table.h" |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // address for lazy deoptimization) and compute the fp-to-sp delta in | 148 // address for lazy deoptimization) and compute the fp-to-sp delta in |
149 // register a4. | 149 // register a4. |
150 __ mov(a3, ra); | 150 __ mov(a3, ra); |
151 // Correct one word for bailout id. | 151 // Correct one word for bailout id. |
152 __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); | 152 __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); |
153 | 153 |
154 __ Dsubu(a4, fp, a4); | 154 __ Dsubu(a4, fp, a4); |
155 | 155 |
156 // Allocate a new deoptimizer object. | 156 // Allocate a new deoptimizer object. |
157 __ PrepareCallCFunction(6, a5); | 157 __ PrepareCallCFunction(6, a5); |
158 // Pass six arguments, according to O32 or n64 ABI. a0..a3 are same for both. | 158 // Pass six arguments, according to n64 ABI. |
159 __ li(a1, Operand(type())); // bailout type, | 159 __ mov(a0, zero_reg); |
| 160 Label context_check; |
| 161 __ ld(a1, MemOperand(fp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
| 162 __ JumpIfSmi(a1, &context_check); |
160 __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 163 __ ld(a0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 164 __ bind(&context_check); |
| 165 __ li(a1, Operand(type())); // Bailout type. |
161 // a2: bailout id already loaded. | 166 // a2: bailout id already loaded. |
162 // a3: code address or 0 already loaded. | 167 // a3: code address or 0 already loaded. |
163 // a4: already has fp-to-sp delta. | 168 // a4: already has fp-to-sp delta. |
164 __ li(a5, Operand(ExternalReference::isolate_address(isolate()))); | 169 __ li(a5, Operand(ExternalReference::isolate_address(isolate()))); |
165 | 170 |
166 // Call Deoptimizer::New(). | 171 // Call Deoptimizer::New(). |
167 { | 172 { |
168 AllowExternalCallThatCantCauseGC scope(masm()); | 173 AllowExternalCallThatCantCauseGC scope(masm()); |
169 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); | 174 __ CallCFunction(ExternalReference::new_deoptimizer_function(isolate()), 6); |
170 } | 175 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // No embedded constant pool support. | 380 // No embedded constant pool support. |
376 UNREACHABLE(); | 381 UNREACHABLE(); |
377 } | 382 } |
378 | 383 |
379 | 384 |
380 #undef __ | 385 #undef __ |
381 | 386 |
382 | 387 |
383 } // namespace internal | 388 } // namespace internal |
384 } // namespace v8 | 389 } // namespace v8 |
OLD | NEW |