OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 Address entry = table_entry->address; | 339 Address entry = table_entry->address; |
340 DeoptComment(table_entry->deopt_info); | 340 DeoptComment(table_entry->deopt_info); |
341 | 341 |
342 // Second-level deopt table entries are contiguous and small, so instead | 342 // Second-level deopt table entries are contiguous and small, so instead |
343 // of loading the full, absolute address of each one, load an immediate | 343 // of loading the full, absolute address of each one, load an immediate |
344 // offset which will be added to the base address later. | 344 // offset which will be added to the base address later. |
345 __ mov(entry_offset, Operand(entry - base)); | 345 __ mov(entry_offset, Operand(entry - base)); |
346 | 346 |
347 if (table_entry->needs_frame) { | 347 if (table_entry->needs_frame) { |
348 DCHECK(!info()->saves_caller_doubles()); | 348 DCHECK(!info()->saves_caller_doubles()); |
349 if (needs_frame.is_bound()) { | 349 Comment(";;; call deopt with frame"); |
350 __ b(&needs_frame); | 350 __ PushFixedFrame(); |
351 } else { | 351 __ bl(&needs_frame); |
352 __ bind(&needs_frame); | |
353 Comment(";;; call deopt with frame"); | |
354 __ PushFixedFrame(); | |
355 // This variant of deopt can only be used with stubs. Since we don't | |
356 // have a function pointer to install in the stack frame that we're | |
357 // building, install a special marker there instead. | |
358 DCHECK(info()->IsStub()); | |
359 __ mov(ip, Operand(Smi::FromInt(StackFrame::STUB))); | |
360 __ push(ip); | |
361 __ add(fp, sp, | |
362 Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | |
363 __ bind(&call_deopt_entry); | |
364 // Add the base address to the offset previously loaded in | |
365 // entry_offset. | |
366 __ add(entry_offset, entry_offset, | |
367 Operand(ExternalReference::ForDeoptEntry(base))); | |
368 __ blx(entry_offset); | |
369 } | |
370 | |
371 masm()->CheckConstPool(false, false); | 352 masm()->CheckConstPool(false, false); |
372 } else { | 353 } else { |
373 // The last entry can fall through into `call_deopt_entry`, avoiding a | 354 __ bl(&call_deopt_entry); |
374 // branch. | |
375 bool need_branch = ((i + 1) != length) || call_deopt_entry.is_bound(); | |
376 | 355 |
377 if (need_branch) __ b(&call_deopt_entry); | 356 bool need_branch = ((i + 1) != length); |
jbramley
2015/03/10 14:24:40
Because every entry (including the last) now has a
loislo
2015/03/10 14:30:36
Done.
| |
378 | |
379 masm()->CheckConstPool(false, !need_branch); | 357 masm()->CheckConstPool(false, !need_branch); |
380 } | 358 } |
381 } | 359 } |
382 | 360 |
383 if (!call_deopt_entry.is_bound()) { | 361 if (needs_frame.is_linked()) { |
384 Comment(";;; call deopt"); | 362 __ bind(&needs_frame); |
385 __ bind(&call_deopt_entry); | 363 // This variant of deopt can only be used with stubs. Since we don't |
364 // have a function pointer to install in the stack frame that we're | |
365 // building, install a special marker there instead. | |
366 DCHECK(info()->IsStub()); | |
367 __ mov(ip, Operand(Smi::FromInt(StackFrame::STUB))); | |
368 __ push(ip); | |
369 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | |
370 } | |
386 | 371 |
387 if (info()->saves_caller_doubles()) { | 372 Comment(";;; call deopt"); |
388 DCHECK(info()->IsStub()); | 373 __ bind(&call_deopt_entry); |
389 RestoreCallerDoubles(); | |
390 } | |
391 | 374 |
392 // Add the base address to the offset previously loaded in entry_offset. | 375 if (info()->saves_caller_doubles()) { |
393 __ add(entry_offset, entry_offset, | 376 DCHECK(info()->IsStub()); |
394 Operand(ExternalReference::ForDeoptEntry(base))); | 377 RestoreCallerDoubles(); |
395 __ blx(entry_offset); | |
396 } | 378 } |
379 | |
380 // Add the base address to the offset previously loaded in entry_offset. | |
381 __ add(entry_offset, entry_offset, | |
382 Operand(ExternalReference::ForDeoptEntry(base))); | |
383 __ bx(entry_offset); | |
397 } | 384 } |
398 | 385 |
399 // Force constant pool emission at the end of the deopt jump table to make | 386 // Force constant pool emission at the end of the deopt jump table to make |
400 // sure that no constant pools are emitted after. | 387 // sure that no constant pools are emitted after. |
401 masm()->CheckConstPool(true, false); | 388 masm()->CheckConstPool(true, false); |
402 | 389 |
403 // The deoptimization jump table is the last part of the instruction | 390 // The deoptimization jump table is the last part of the instruction |
404 // sequence. Mark the generated code as done unless we bailed out. | 391 // sequence. Mark the generated code as done unless we bailed out. |
405 if (!is_aborted()) status_ = DONE; | 392 if (!is_aborted()) status_ = DONE; |
406 return !is_aborted(); | 393 return !is_aborted(); |
(...skipping 5579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5986 __ Push(scope_info); | 5973 __ Push(scope_info); |
5987 __ push(ToRegister(instr->function())); | 5974 __ push(ToRegister(instr->function())); |
5988 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5975 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5989 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5976 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5990 } | 5977 } |
5991 | 5978 |
5992 | 5979 |
5993 #undef __ | 5980 #undef __ |
5994 | 5981 |
5995 } } // namespace v8::internal | 5982 } } // namespace v8::internal |
OLD | NEW |