OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 | 2509 |
2510 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { | 2510 void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
2511 last_lazy_deopt_pc_ = masm()->pc_offset(); | 2511 last_lazy_deopt_pc_ = masm()->pc_offset(); |
2512 DCHECK(instr->HasEnvironment()); | 2512 DCHECK(instr->HasEnvironment()); |
2513 LEnvironment* env = instr->environment(); | 2513 LEnvironment* env = instr->environment(); |
2514 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); | 2514 RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
2515 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); | 2515 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
2516 } | 2516 } |
2517 | 2517 |
2518 | 2518 |
| 2519 void LCodeGen::DoDateField(LDateField* instr) { |
| 2520 Register object = ToRegister(instr->date()); |
| 2521 Register result = ToRegister(instr->result()); |
| 2522 Register temp1 = x10; |
| 2523 Register temp2 = x11; |
| 2524 Smi* index = instr->index(); |
| 2525 |
| 2526 DCHECK(object.is(result) && object.Is(x0)); |
| 2527 DCHECK(instr->IsMarkedAsCall()); |
| 2528 |
| 2529 if (index->value() == 0) { |
| 2530 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); |
| 2531 } else { |
| 2532 Label runtime, done; |
| 2533 if (index->value() < JSDate::kFirstUncachedField) { |
| 2534 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 2535 __ Mov(temp1, Operand(stamp)); |
| 2536 __ Ldr(temp1, MemOperand(temp1)); |
| 2537 __ Ldr(temp2, FieldMemOperand(object, JSDate::kCacheStampOffset)); |
| 2538 __ Cmp(temp1, temp2); |
| 2539 __ B(ne, &runtime); |
| 2540 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset + |
| 2541 kPointerSize * index->value())); |
| 2542 __ B(&done); |
| 2543 } |
| 2544 |
| 2545 __ Bind(&runtime); |
| 2546 __ Mov(x1, Operand(index)); |
| 2547 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
| 2548 __ Bind(&done); |
| 2549 } |
| 2550 } |
| 2551 |
| 2552 |
2519 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { | 2553 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { |
2520 Deoptimizer::BailoutType type = instr->hydrogen()->type(); | 2554 Deoptimizer::BailoutType type = instr->hydrogen()->type(); |
2521 // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the | 2555 // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the |
2522 // needed return address), even though the implementation of LAZY and EAGER is | 2556 // needed return address), even though the implementation of LAZY and EAGER is |
2523 // now identical. When LAZY is eventually completely folded into EAGER, remove | 2557 // now identical. When LAZY is eventually completely folded into EAGER, remove |
2524 // the special case below. | 2558 // the special case below. |
2525 if (info()->IsStub() && (type == Deoptimizer::EAGER)) { | 2559 if (info()->IsStub() && (type == Deoptimizer::EAGER)) { |
2526 type = Deoptimizer::LAZY; | 2560 type = Deoptimizer::LAZY; |
2527 } | 2561 } |
2528 | 2562 |
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5779 Handle<ScopeInfo> scope_info = instr->scope_info(); | 5813 Handle<ScopeInfo> scope_info = instr->scope_info(); |
5780 __ Push(scope_info); | 5814 __ Push(scope_info); |
5781 __ Push(ToRegister(instr->function())); | 5815 __ Push(ToRegister(instr->function())); |
5782 CallRuntime(Runtime::kPushBlockContext, instr); | 5816 CallRuntime(Runtime::kPushBlockContext, instr); |
5783 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5817 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5784 } | 5818 } |
5785 | 5819 |
5786 | 5820 |
5787 } // namespace internal | 5821 } // namespace internal |
5788 } // namespace v8 | 5822 } // namespace v8 |
OLD | NEW |