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

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

Issue 2372113004: [turbofan] JSGenericLowering mostly uses builtins instead of code stubs now (Closed)
Patch Set: Ross' comments Created 4 years, 2 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/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 increment_loop_depth(); 1005 increment_loop_depth();
1006 1006
1007 // If the object is null or undefined, skip over the loop, otherwise convert 1007 // If the object is null or undefined, skip over the loop, otherwise convert
1008 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4. 1008 // it to a JS receiver. See ECMA-262 version 5, section 12.6.4.
1009 Label convert, done_convert; 1009 Label convert, done_convert;
1010 __ JumpIfSmi(x0, &convert); 1010 __ JumpIfSmi(x0, &convert);
1011 __ JumpIfObjectType(x0, x10, x11, FIRST_JS_RECEIVER_TYPE, &done_convert, ge); 1011 __ JumpIfObjectType(x0, x10, x11, FIRST_JS_RECEIVER_TYPE, &done_convert, ge);
1012 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, &exit); 1012 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, &exit);
1013 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, &exit); 1013 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, &exit);
1014 __ Bind(&convert); 1014 __ Bind(&convert);
1015 ToObjectStub stub(isolate()); 1015 __ Call(isolate()->builtins()->ToObject(), RelocInfo::CODE_TARGET);
1016 __ CallStub(&stub);
1017 RestoreContext(); 1016 RestoreContext();
1018 __ Bind(&done_convert); 1017 __ Bind(&done_convert);
1019 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); 1018 PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER);
1020 __ Push(x0); 1019 __ Push(x0);
1021 1020
1022 // Check cache validity in generated code. If we cannot guarantee cache 1021 // Check cache validity in generated code. If we cannot guarantee cache
1023 // validity, call the runtime system to check cache validity or get the 1022 // validity, call the runtime system to check cache validity or get the
1024 // property names in a fixed array. Note: Proxies never have an enum cache, 1023 // property names in a fixed array. Note: Proxies never have an enum cache,
1025 // so will always take the slow path. 1024 // so will always take the slow path.
1026 Label call_runtime; 1025 Label call_runtime;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 __ Cmp(x11, x2); 1100 __ Cmp(x11, x2);
1102 __ B(eq, &update_each); 1101 __ B(eq, &update_each);
1103 1102
1104 // We need to filter the key, record slow-path here. 1103 // We need to filter the key, record slow-path here.
1105 int const vector_index = SmiFromSlot(slot)->value(); 1104 int const vector_index = SmiFromSlot(slot)->value();
1106 __ EmitLoadTypeFeedbackVector(x3); 1105 __ EmitLoadTypeFeedbackVector(x3);
1107 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); 1106 __ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
1108 __ Str(x10, FieldMemOperand(x3, FixedArray::OffsetOfElementAt(vector_index))); 1107 __ Str(x10, FieldMemOperand(x3, FixedArray::OffsetOfElementAt(vector_index)));
1109 1108
1110 // x0 contains the key. The receiver in x1 is the second argument to the 1109 // x0 contains the key. The receiver in x1 is the second argument to the
1111 // ForInFilterStub. ForInFilter returns undefined if the receiver doesn't 1110 // ForInFilter. ForInFilter returns undefined if the receiver doesn't
1112 // have the key or returns the name-converted key. 1111 // have the key or returns the name-converted key.
1113 ForInFilterStub filter_stub(isolate()); 1112 __ Call(isolate()->builtins()->ForInFilter(), RelocInfo::CODE_TARGET);
1114 __ CallStub(&filter_stub);
1115 RestoreContext(); 1113 RestoreContext();
1116 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); 1114 PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER);
1117 __ CompareRoot(result_register(), Heap::kUndefinedValueRootIndex); 1115 __ CompareRoot(result_register(), Heap::kUndefinedValueRootIndex);
1118 __ B(eq, loop_statement.continue_label()); 1116 __ B(eq, loop_statement.continue_label());
1119 1117
1120 // Update the 'each' property or variable from the possibly filtered 1118 // Update the 'each' property or variable from the possibly filtered
1121 // entry in register x0. 1119 // entry in register x0.
1122 __ Bind(&update_each); 1120 __ Bind(&update_each);
1123 // Perform the assignment as if via '='. 1121 // Perform the assignment as if via '='.
1124 { EffectContext context(this); 1122 { EffectContext context(this);
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2964 } 2962 }
2965 break; 2963 break;
2966 } 2964 }
2967 case Token::TYPEOF: { 2965 case Token::TYPEOF: {
2968 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)"); 2966 Comment cmnt(masm_, "[ UnaryOperation (TYPEOF)");
2969 { 2967 {
2970 AccumulatorValueContext context(this); 2968 AccumulatorValueContext context(this);
2971 VisitForTypeofValue(expr->expression()); 2969 VisitForTypeofValue(expr->expression());
2972 } 2970 }
2973 __ Mov(x3, x0); 2971 __ Mov(x3, x0);
2974 TypeofStub typeof_stub(isolate()); 2972 __ Call(isolate()->builtins()->Typeof(), RelocInfo::CODE_TARGET);
2975 __ CallStub(&typeof_stub);
2976 context()->Plug(x0); 2973 context()->Plug(x0);
2977 break; 2974 break;
2978 } 2975 }
2979 default: 2976 default:
2980 UNREACHABLE(); 2977 UNREACHABLE();
2981 } 2978 }
2982 } 2979 }
2983 2980
2984 2981
2985 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { 2982 void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
3340 EmitHasProperty(); 3337 EmitHasProperty();
3341 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 3338 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
3342 __ CompareRoot(x0, Heap::kTrueValueRootIndex); 3339 __ CompareRoot(x0, Heap::kTrueValueRootIndex);
3343 Split(eq, if_true, if_false, fall_through); 3340 Split(eq, if_true, if_false, fall_through);
3344 break; 3341 break;
3345 3342
3346 case Token::INSTANCEOF: { 3343 case Token::INSTANCEOF: {
3347 VisitForAccumulatorValue(expr->right()); 3344 VisitForAccumulatorValue(expr->right());
3348 SetExpressionPosition(expr); 3345 SetExpressionPosition(expr);
3349 PopOperand(x1); 3346 PopOperand(x1);
3350 InstanceOfStub stub(isolate()); 3347 __ Call(isolate()->builtins()->InstanceOf(), RelocInfo::CODE_TARGET);
3351 __ CallStub(&stub);
3352 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL); 3348 PrepareForBailoutBeforeSplit(expr, false, NULL, NULL);
3353 __ CompareRoot(x0, Heap::kTrueValueRootIndex); 3349 __ CompareRoot(x0, Heap::kTrueValueRootIndex);
3354 Split(eq, if_true, if_false, fall_through); 3350 Split(eq, if_true, if_false, fall_through);
3355 break; 3351 break;
3356 } 3352 }
3357 3353
3358 default: { 3354 default: {
3359 VisitForAccumulatorValue(expr->right()); 3355 VisitForAccumulatorValue(expr->right());
3360 SetExpressionPosition(expr); 3356 SetExpressionPosition(expr);
3361 Condition cond = CompareIC::ComputeCondition(op); 3357 Condition cond = CompareIC::ComputeCondition(op);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3742 } 3738 }
3743 3739
3744 return INTERRUPT; 3740 return INTERRUPT;
3745 } 3741 }
3746 3742
3747 3743
3748 } // namespace internal 3744 } // namespace internal
3749 } // namespace v8 3745 } // namespace v8
3750 3746
3751 #endif // V8_TARGET_ARCH_ARM64 3747 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698