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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/execution.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 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 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 __ b(eq, &exit); 1076 __ b(eq, &exit);
1077 1077
1078 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); 1078 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
1079 1079
1080 // Convert the object to a JS object. 1080 // Convert the object to a JS object.
1081 Label convert, done_convert; 1081 Label convert, done_convert;
1082 __ JumpIfSmi(r0, &convert); 1082 __ JumpIfSmi(r0, &convert);
1083 __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE); 1083 __ CompareObjectType(r0, r1, r1, FIRST_SPEC_OBJECT_TYPE);
1084 __ b(ge, &done_convert); 1084 __ b(ge, &done_convert);
1085 __ bind(&convert); 1085 __ bind(&convert);
1086 __ push(r0); 1086 ToObjectStub stub(isolate());
1087 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1087 __ CallStub(&stub);
1088 __ bind(&done_convert); 1088 __ bind(&done_convert);
1089 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); 1089 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG);
1090 __ push(r0); 1090 __ push(r0);
1091 1091
1092 // Check for proxies. 1092 // Check for proxies.
1093 Label call_runtime; 1093 Label call_runtime;
1094 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1094 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1095 __ CompareObjectType(r0, r1, r1, LAST_JS_PROXY_TYPE); 1095 __ CompareObjectType(r0, r1, r1, LAST_JS_PROXY_TYPE);
1096 __ b(le, &call_runtime); 1096 __ b(le, &call_runtime);
1097 1097
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 DCHECK_EQ(args->length(), 1); 4011 DCHECK_EQ(args->length(), 1);
4012 // Load the argument into r0 and call the stub. 4012 // Load the argument into r0 and call the stub.
4013 VisitForAccumulatorValue(args->at(0)); 4013 VisitForAccumulatorValue(args->at(0));
4014 4014
4015 NumberToStringStub stub(isolate()); 4015 NumberToStringStub stub(isolate());
4016 __ CallStub(&stub); 4016 __ CallStub(&stub);
4017 context()->Plug(r0); 4017 context()->Plug(r0);
4018 } 4018 }
4019 4019
4020 4020
4021 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
4022 ZoneList<Expression*>* args = expr->arguments();
4023 DCHECK_EQ(1, args->length());
4024
4025 // Load the argument into r0 and convert it.
4026 VisitForAccumulatorValue(args->at(0));
4027
4028 ToObjectStub stub(isolate());
4029 __ CallStub(&stub);
4030 context()->Plug(r0);
4031 }
4032
4033
4021 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 4034 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
4022 ZoneList<Expression*>* args = expr->arguments(); 4035 ZoneList<Expression*>* args = expr->arguments();
4023 DCHECK(args->length() == 1); 4036 DCHECK(args->length() == 1);
4024 VisitForAccumulatorValue(args->at(0)); 4037 VisitForAccumulatorValue(args->at(0));
4025 4038
4026 Label done; 4039 Label done;
4027 StringCharFromCodeGenerator generator(r0, r1); 4040 StringCharFromCodeGenerator generator(r0, r1);
4028 generator.GenerateFast(masm_); 4041 generator.GenerateFast(masm_);
4029 __ jmp(&done); 4042 __ jmp(&done);
4030 4043
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
5455 DCHECK(interrupt_address == 5468 DCHECK(interrupt_address ==
5456 isolate->builtins()->OsrAfterStackCheck()->entry()); 5469 isolate->builtins()->OsrAfterStackCheck()->entry());
5457 return OSR_AFTER_STACK_CHECK; 5470 return OSR_AFTER_STACK_CHECK;
5458 } 5471 }
5459 5472
5460 5473
5461 } // namespace internal 5474 } // namespace internal
5462 } // namespace v8 5475 } // namespace v8
5463 5476
5464 #endif // V8_TARGET_ARCH_ARM 5477 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698