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

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

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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/full-codegen.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 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 __ Cmp(x0, null_value); 1078 __ Cmp(x0, null_value);
1079 __ B(eq, &exit); 1079 __ B(eq, &exit);
1080 1080
1081 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); 1081 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
1082 1082
1083 // Convert the object to a JS object. 1083 // Convert the object to a JS object.
1084 Label convert, done_convert; 1084 Label convert, done_convert;
1085 __ JumpIfSmi(x0, &convert); 1085 __ JumpIfSmi(x0, &convert);
1086 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, &done_convert, ge); 1086 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, &done_convert, ge);
1087 __ Bind(&convert); 1087 __ Bind(&convert);
1088 __ Push(x0); 1088 ToObjectStub stub(isolate());
1089 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1089 __ CallStub(&stub);
1090 __ Bind(&done_convert); 1090 __ Bind(&done_convert);
1091 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); 1091 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG);
1092 __ Push(x0); 1092 __ Push(x0);
1093 1093
1094 // Check for proxies. 1094 // Check for proxies.
1095 Label call_runtime; 1095 Label call_runtime;
1096 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1096 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1097 __ JumpIfObjectType(x0, x10, x11, LAST_JS_PROXY_TYPE, &call_runtime, le); 1097 __ JumpIfObjectType(x0, x10, x11, LAST_JS_PROXY_TYPE, &call_runtime, le);
1098 1098
1099 // Check cache validity in generated code. This is a fast case for 1099 // Check cache validity in generated code. This is a fast case for
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after
3719 3719
3720 // Load the argument into x0 and call the stub. 3720 // Load the argument into x0 and call the stub.
3721 VisitForAccumulatorValue(args->at(0)); 3721 VisitForAccumulatorValue(args->at(0));
3722 3722
3723 NumberToStringStub stub(isolate()); 3723 NumberToStringStub stub(isolate());
3724 __ CallStub(&stub); 3724 __ CallStub(&stub);
3725 context()->Plug(x0); 3725 context()->Plug(x0);
3726 } 3726 }
3727 3727
3728 3728
3729 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
3730 ZoneList<Expression*>* args = expr->arguments();
3731 DCHECK_EQ(1, args->length());
3732
3733 // Load the argument into x0 and convert it.
3734 VisitForAccumulatorValue(args->at(0));
3735
3736 ToObjectStub stub(isolate());
3737 __ CallStub(&stub);
3738 context()->Plug(x0);
3739 }
3740
3741
3729 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 3742 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3730 ZoneList<Expression*>* args = expr->arguments(); 3743 ZoneList<Expression*>* args = expr->arguments();
3731 DCHECK(args->length() == 1); 3744 DCHECK(args->length() == 1);
3732 3745
3733 VisitForAccumulatorValue(args->at(0)); 3746 VisitForAccumulatorValue(args->at(0));
3734 3747
3735 Label done; 3748 Label done;
3736 Register code = x0; 3749 Register code = x0;
3737 Register result = x1; 3750 Register result = x1;
3738 3751
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5441 } 5454 }
5442 5455
5443 return INTERRUPT; 5456 return INTERRUPT;
5444 } 5457 }
5445 5458
5446 5459
5447 } // namespace internal 5460 } // namespace internal
5448 } // namespace v8 5461 } // namespace v8
5449 5462
5450 #endif // V8_TARGET_ARCH_ARM64 5463 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698