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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 __ LoadRoot(null_value, Heap::kNullValueRootIndex); 1075 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
1076 __ Branch(&exit, eq, a0, Operand(null_value)); 1076 __ Branch(&exit, eq, a0, Operand(null_value));
1077 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); 1077 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
1078 __ mov(a0, v0); 1078 __ mov(a0, v0);
1079 // Convert the object to a JS object. 1079 // Convert the object to a JS object.
1080 Label convert, done_convert; 1080 Label convert, done_convert;
1081 __ JumpIfSmi(a0, &convert); 1081 __ JumpIfSmi(a0, &convert);
1082 __ GetObjectType(a0, a1, a1); 1082 __ GetObjectType(a0, a1, a1);
1083 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 1083 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
1084 __ bind(&convert); 1084 __ bind(&convert);
1085 __ push(a0); 1085 ToObjectStub stub(isolate());
1086 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1086 __ CallStub(&stub);
1087 __ mov(a0, v0); 1087 __ mov(a0, v0);
1088 __ bind(&done_convert); 1088 __ bind(&done_convert);
1089 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); 1089 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG);
1090 __ push(a0); 1090 __ push(a0);
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 __ GetObjectType(a0, a1, a1); 1095 __ GetObjectType(a0, a1, a1);
1096 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); 1096 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE));
(...skipping 2927 matching lines...) Expand 10 before | Expand all | Expand 10 after
4024 // Load the argument into a0 and call the stub. 4024 // Load the argument into a0 and call the stub.
4025 VisitForAccumulatorValue(args->at(0)); 4025 VisitForAccumulatorValue(args->at(0));
4026 __ mov(a0, result_register()); 4026 __ mov(a0, result_register());
4027 4027
4028 NumberToStringStub stub(isolate()); 4028 NumberToStringStub stub(isolate());
4029 __ CallStub(&stub); 4029 __ CallStub(&stub);
4030 context()->Plug(v0); 4030 context()->Plug(v0);
4031 } 4031 }
4032 4032
4033 4033
4034 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
4035 ZoneList<Expression*>* args = expr->arguments();
4036 DCHECK_EQ(1, args->length());
4037
4038 // Load the argument into a0 and convert it.
4039 VisitForAccumulatorValue(args->at(0));
4040 __ mov(a0, result_register());
4041
4042 ToObjectStub stub(isolate());
4043 __ CallStub(&stub);
4044 context()->Plug(v0);
4045 }
4046
4047
4034 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 4048 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
4035 ZoneList<Expression*>* args = expr->arguments(); 4049 ZoneList<Expression*>* args = expr->arguments();
4036 DCHECK(args->length() == 1); 4050 DCHECK(args->length() == 1);
4037 4051
4038 VisitForAccumulatorValue(args->at(0)); 4052 VisitForAccumulatorValue(args->at(0));
4039 4053
4040 Label done; 4054 Label done;
4041 StringCharFromCodeGenerator generator(v0, a1); 4055 StringCharFromCodeGenerator generator(v0, a1);
4042 generator.GenerateFast(masm_); 4056 generator.GenerateFast(masm_);
4043 __ jmp(&done); 4057 __ jmp(&done);
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5427 reinterpret_cast<uint64_t>( 5441 reinterpret_cast<uint64_t>(
5428 isolate->builtins()->OsrAfterStackCheck()->entry())); 5442 isolate->builtins()->OsrAfterStackCheck()->entry()));
5429 return OSR_AFTER_STACK_CHECK; 5443 return OSR_AFTER_STACK_CHECK;
5430 } 5444 }
5431 5445
5432 5446
5433 } // namespace internal 5447 } // namespace internal
5434 } // namespace v8 5448 } // namespace v8
5435 5449
5436 #endif // V8_TARGET_ARCH_MIPS64 5450 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698