OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 __ beq(&exit); | 1039 __ beq(&exit); |
1040 | 1040 |
1041 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); | 1041 PrepareForBailoutForId(stmt->PrepareId(), TOS_REG); |
1042 | 1042 |
1043 // Convert the object to a JS object. | 1043 // Convert the object to a JS object. |
1044 Label convert, done_convert; | 1044 Label convert, done_convert; |
1045 __ JumpIfSmi(r3, &convert); | 1045 __ JumpIfSmi(r3, &convert); |
1046 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); | 1046 __ CompareObjectType(r3, r4, r4, FIRST_SPEC_OBJECT_TYPE); |
1047 __ bge(&done_convert); | 1047 __ bge(&done_convert); |
1048 __ bind(&convert); | 1048 __ bind(&convert); |
1049 __ push(r3); | 1049 ToObjectStub stub(isolate()); |
1050 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1050 __ CallStub(&stub); |
1051 __ bind(&done_convert); | 1051 __ bind(&done_convert); |
1052 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 1052 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1053 __ push(r3); | 1053 __ push(r3); |
1054 | 1054 |
1055 // Check for proxies. | 1055 // Check for proxies. |
1056 Label call_runtime; | 1056 Label call_runtime; |
1057 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1057 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1058 __ CompareObjectType(r3, r4, r4, LAST_JS_PROXY_TYPE); | 1058 __ CompareObjectType(r3, r4, r4, LAST_JS_PROXY_TYPE); |
1059 __ ble(&call_runtime); | 1059 __ ble(&call_runtime); |
1060 | 1060 |
(...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4022 DCHECK_EQ(args->length(), 1); | 4022 DCHECK_EQ(args->length(), 1); |
4023 // Load the argument into r3 and call the stub. | 4023 // Load the argument into r3 and call the stub. |
4024 VisitForAccumulatorValue(args->at(0)); | 4024 VisitForAccumulatorValue(args->at(0)); |
4025 | 4025 |
4026 NumberToStringStub stub(isolate()); | 4026 NumberToStringStub stub(isolate()); |
4027 __ CallStub(&stub); | 4027 __ CallStub(&stub); |
4028 context()->Plug(r3); | 4028 context()->Plug(r3); |
4029 } | 4029 } |
4030 | 4030 |
4031 | 4031 |
| 4032 void FullCodeGenerator::EmitToObject(CallRuntime* expr) { |
| 4033 ZoneList<Expression*>* args = expr->arguments(); |
| 4034 DCHECK_EQ(1, args->length()); |
| 4035 // Load the argument into r3 and convert it. |
| 4036 VisitForAccumulatorValue(args->at(0)); |
| 4037 |
| 4038 ToObjectStub stub(isolate()); |
| 4039 __ CallStub(&stub); |
| 4040 context()->Plug(r3); |
| 4041 } |
| 4042 |
| 4043 |
4032 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 4044 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
4033 ZoneList<Expression*>* args = expr->arguments(); | 4045 ZoneList<Expression*>* args = expr->arguments(); |
4034 DCHECK(args->length() == 1); | 4046 DCHECK(args->length() == 1); |
4035 VisitForAccumulatorValue(args->at(0)); | 4047 VisitForAccumulatorValue(args->at(0)); |
4036 | 4048 |
4037 Label done; | 4049 Label done; |
4038 StringCharFromCodeGenerator generator(r3, r4); | 4050 StringCharFromCodeGenerator generator(r3, r4); |
4039 generator.GenerateFast(masm_); | 4051 generator.GenerateFast(masm_); |
4040 __ b(&done); | 4052 __ b(&done); |
4041 | 4053 |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5405 return ON_STACK_REPLACEMENT; | 5417 return ON_STACK_REPLACEMENT; |
5406 } | 5418 } |
5407 | 5419 |
5408 DCHECK(interrupt_address == | 5420 DCHECK(interrupt_address == |
5409 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5421 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5410 return OSR_AFTER_STACK_CHECK; | 5422 return OSR_AFTER_STACK_CHECK; |
5411 } | 5423 } |
5412 } // namespace internal | 5424 } // namespace internal |
5413 } // namespace v8 | 5425 } // namespace v8 |
5414 #endif // V8_TARGET_ARCH_PPC | 5426 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |