Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1167813003: [date] Refactor the %_DateField intrinsic to be optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.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 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); 2621 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
2622 } 2622 }
2623 2623
2624 2624
2625 void LCodeGen::DoDateField(LDateField* instr) { 2625 void LCodeGen::DoDateField(LDateField* instr) {
2626 Register object = ToRegister(instr->date()); 2626 Register object = ToRegister(instr->date());
2627 Register result = ToRegister(instr->result()); 2627 Register result = ToRegister(instr->result());
2628 Register temp1 = x10; 2628 Register temp1 = x10;
2629 Register temp2 = x11; 2629 Register temp2 = x11;
2630 Smi* index = instr->index(); 2630 Smi* index = instr->index();
2631 Label runtime, done;
2632 2631
2633 DCHECK(object.is(result) && object.Is(x0)); 2632 DCHECK(object.is(result) && object.Is(x0));
2634 DCHECK(instr->IsMarkedAsCall()); 2633 DCHECK(instr->IsMarkedAsCall());
2635 2634
2636 DeoptimizeIfSmi(object, instr, Deoptimizer::kSmi);
2637 __ CompareObjectType(object, temp1, temp1, JS_DATE_TYPE);
2638 DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject);
2639
2640 if (index->value() == 0) { 2635 if (index->value() == 0) {
2641 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); 2636 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
2642 } else { 2637 } else {
2638 Label runtime, done;
2643 if (index->value() < JSDate::kFirstUncachedField) { 2639 if (index->value() < JSDate::kFirstUncachedField) {
2644 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); 2640 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
2645 __ Mov(temp1, Operand(stamp)); 2641 __ Mov(temp1, Operand(stamp));
2646 __ Ldr(temp1, MemOperand(temp1)); 2642 __ Ldr(temp1, MemOperand(temp1));
2647 __ Ldr(temp2, FieldMemOperand(object, JSDate::kCacheStampOffset)); 2643 __ Ldr(temp2, FieldMemOperand(object, JSDate::kCacheStampOffset));
2648 __ Cmp(temp1, temp2); 2644 __ Cmp(temp1, temp2);
2649 __ B(ne, &runtime); 2645 __ B(ne, &runtime);
2650 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset + 2646 __ Ldr(result, FieldMemOperand(object, JSDate::kValueOffset +
2651 kPointerSize * index->value())); 2647 kPointerSize * index->value()));
2652 __ B(&done); 2648 __ B(&done);
2653 } 2649 }
2654 2650
2655 __ Bind(&runtime); 2651 __ Bind(&runtime);
2656 __ Mov(x1, Operand(index)); 2652 __ Mov(x1, Operand(index));
2657 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); 2653 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
2654 __ Bind(&done);
2658 } 2655 }
2659
2660 __ Bind(&done);
2661 } 2656 }
2662 2657
2663 2658
2664 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { 2659 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
2665 Deoptimizer::BailoutType type = instr->hydrogen()->type(); 2660 Deoptimizer::BailoutType type = instr->hydrogen()->type();
2666 // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the 2661 // TODO(danno): Stubs expect all deopts to be lazy for historical reasons (the
2667 // needed return address), even though the implementation of LAZY and EAGER is 2662 // needed return address), even though the implementation of LAZY and EAGER is
2668 // now identical. When LAZY is eventually completely folded into EAGER, remove 2663 // now identical. When LAZY is eventually completely folded into EAGER, remove
2669 // the special case below. 2664 // the special case below.
2670 if (info()->IsStub() && (type == Deoptimizer::EAGER)) { 2665 if (info()->IsStub() && (type == Deoptimizer::EAGER)) {
(...skipping 3428 matching lines...) Expand 10 before | Expand all | Expand 10 after
6099 Handle<ScopeInfo> scope_info = instr->scope_info(); 6094 Handle<ScopeInfo> scope_info = instr->scope_info();
6100 __ Push(scope_info); 6095 __ Push(scope_info);
6101 __ Push(ToRegister(instr->function())); 6096 __ Push(ToRegister(instr->function()));
6102 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6097 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6103 RecordSafepoint(Safepoint::kNoLazyDeopt); 6098 RecordSafepoint(Safepoint::kNoLazyDeopt);
6104 } 6099 }
6105 6100
6106 6101
6107 } // namespace internal 6102 } // namespace internal
6108 } // namespace v8 6103 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698