OLD | NEW |
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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 // Non-JS objects have class null. | 2849 // Non-JS objects have class null. |
2850 __ bind(&null); | 2850 __ bind(&null); |
2851 __ LoadRoot(r0, Heap::kNullValueRootIndex); | 2851 __ LoadRoot(r0, Heap::kNullValueRootIndex); |
2852 | 2852 |
2853 // All done. | 2853 // All done. |
2854 __ bind(&done); | 2854 __ bind(&done); |
2855 | 2855 |
2856 context()->Plug(r0); | 2856 context()->Plug(r0); |
2857 } | 2857 } |
2858 | 2858 |
| 2859 |
| 2860 void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { |
| 2861 ZoneList<Expression*>* args = expr->arguments(); |
| 2862 DCHECK(args->length() == 1); |
| 2863 VisitForAccumulatorValue(args->at(0)); // Load the object. |
| 2864 |
| 2865 Label done; |
| 2866 // If the object is a smi return the object. |
| 2867 __ JumpIfSmi(r0, &done); |
| 2868 // If the object is not a value type, return the object. |
| 2869 __ CompareObjectType(r0, r1, r1, JS_VALUE_TYPE); |
| 2870 __ ldr(r0, FieldMemOperand(r0, JSValue::kValueOffset), eq); |
| 2871 |
| 2872 __ bind(&done); |
| 2873 context()->Plug(r0); |
| 2874 } |
| 2875 |
2859 | 2876 |
2860 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { | 2877 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
2861 ZoneList<Expression*>* args = expr->arguments(); | 2878 ZoneList<Expression*>* args = expr->arguments(); |
2862 DCHECK(args->length() == 1); | 2879 DCHECK(args->length() == 1); |
2863 VisitForAccumulatorValue(args->at(0)); | 2880 VisitForAccumulatorValue(args->at(0)); |
2864 | 2881 |
2865 Label done; | 2882 Label done; |
2866 StringCharFromCodeGenerator generator(r0, r1); | 2883 StringCharFromCodeGenerator generator(r0, r1); |
2867 generator.GenerateFast(masm_); | 2884 generator.GenerateFast(masm_); |
2868 __ jmp(&done); | 2885 __ jmp(&done); |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3839 DCHECK(interrupt_address == | 3856 DCHECK(interrupt_address == |
3840 isolate->builtins()->OnStackReplacement()->entry()); | 3857 isolate->builtins()->OnStackReplacement()->entry()); |
3841 return ON_STACK_REPLACEMENT; | 3858 return ON_STACK_REPLACEMENT; |
3842 } | 3859 } |
3843 | 3860 |
3844 | 3861 |
3845 } // namespace internal | 3862 } // namespace internal |
3846 } // namespace v8 | 3863 } // namespace v8 |
3847 | 3864 |
3848 #endif // V8_TARGET_ARCH_ARM | 3865 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |