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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 __ LoadRoot(null_value, Heap::kNullValueRootIndex); 1078 __ LoadRoot(null_value, Heap::kNullValueRootIndex);
1079 __ Branch(&exit, eq, a0, Operand(null_value)); 1079 __ Branch(&exit, eq, a0, Operand(null_value));
1080 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); 1080 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG);
1081 __ mov(a0, v0); 1081 __ mov(a0, v0);
1082 // Convert the object to a JS object. 1082 // Convert the object to a JS object.
1083 Label convert, done_convert; 1083 Label convert, done_convert;
1084 __ JumpIfSmi(a0, &convert); 1084 __ JumpIfSmi(a0, &convert);
1085 __ GetObjectType(a0, a1, a1); 1085 __ GetObjectType(a0, a1, a1);
1086 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); 1086 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
1087 __ bind(&convert); 1087 __ bind(&convert);
1088 __ push(a0); 1088 ToObjectStub stub(isolate());
1089 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); 1089 __ CallStub(&stub);
1090 __ mov(a0, v0); 1090 __ mov(a0, v0);
1091 __ bind(&done_convert); 1091 __ bind(&done_convert);
1092 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); 1092 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG);
1093 __ push(a0); 1093 __ push(a0);
1094 1094
1095 // Check for proxies. 1095 // Check for proxies.
1096 Label call_runtime; 1096 Label call_runtime;
1097 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1097 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1098 __ GetObjectType(a0, a1, a1); 1098 __ GetObjectType(a0, a1, a1);
1099 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); 1099 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE));
(...skipping 2921 matching lines...) Expand 10 before | Expand all | Expand 10 after
4021 // Load the argument into a0 and call the stub. 4021 // Load the argument into a0 and call the stub.
4022 VisitForAccumulatorValue(args->at(0)); 4022 VisitForAccumulatorValue(args->at(0));
4023 __ mov(a0, result_register()); 4023 __ mov(a0, result_register());
4024 4024
4025 NumberToStringStub stub(isolate()); 4025 NumberToStringStub stub(isolate());
4026 __ CallStub(&stub); 4026 __ CallStub(&stub);
4027 context()->Plug(v0); 4027 context()->Plug(v0);
4028 } 4028 }
4029 4029
4030 4030
4031 void FullCodeGenerator::EmitToObject(CallRuntime* expr) {
4032 ZoneList<Expression*>* args = expr->arguments();
4033 DCHECK_EQ(1, args->length());
4034
4035 // Load the argument into a0 and convert it.
4036 VisitForAccumulatorValue(args->at(0));
4037 __ mov(a0, result_register());
4038
4039 ToObjectStub stub(isolate());
4040 __ CallStub(&stub);
4041 context()->Plug(v0);
4042 }
4043
4044
4031 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 4045 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
4032 ZoneList<Expression*>* args = expr->arguments(); 4046 ZoneList<Expression*>* args = expr->arguments();
4033 DCHECK(args->length() == 1); 4047 DCHECK(args->length() == 1);
4034 4048
4035 VisitForAccumulatorValue(args->at(0)); 4049 VisitForAccumulatorValue(args->at(0));
4036 4050
4037 Label done; 4051 Label done;
4038 StringCharFromCodeGenerator generator(v0, a1); 4052 StringCharFromCodeGenerator generator(v0, a1);
4039 generator.GenerateFast(masm_); 4053 generator.GenerateFast(masm_);
4040 __ jmp(&done); 4054 __ jmp(&done);
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
5421 reinterpret_cast<uint32_t>( 5435 reinterpret_cast<uint32_t>(
5422 isolate->builtins()->OsrAfterStackCheck()->entry())); 5436 isolate->builtins()->OsrAfterStackCheck()->entry()));
5423 return OSR_AFTER_STACK_CHECK; 5437 return OSR_AFTER_STACK_CHECK;
5424 } 5438 }
5425 5439
5426 5440
5427 } // namespace internal 5441 } // namespace internal
5428 } // namespace v8 5442 } // namespace v8
5429 5443
5430 #endif // V8_TARGET_ARCH_MIPS 5444 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698