OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 | 922 |
923 | 923 |
924 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { | 924 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { |
925 Register result = ToRegister(instr->result()); | 925 Register result = ToRegister(instr->result()); |
926 Register array = ToRegister(instr->InputAt(0)); | 926 Register array = ToRegister(instr->InputAt(0)); |
927 __ movq(result, FieldOperand(array, PixelArray::kLengthOffset)); | 927 __ movq(result, FieldOperand(array, PixelArray::kLengthOffset)); |
928 } | 928 } |
929 | 929 |
930 | 930 |
931 void LCodeGen::DoValueOf(LValueOf* instr) { | 931 void LCodeGen::DoValueOf(LValueOf* instr) { |
932 Abort("Unimplemented: %s", "DoValueOf"); | 932 Register input = ToRegister(instr->InputAt(0)); |
| 933 Register result = ToRegister(instr->result()); |
| 934 ASSERT(input.is(result)); |
| 935 NearLabel done; |
| 936 // If the object is a smi return the object. |
| 937 __ JumpIfSmi(input, &done); |
| 938 |
| 939 // If the object is not a value type, return the object. |
| 940 __ CmpObjectType(input, JS_VALUE_TYPE, kScratchRegister); |
| 941 __ j(not_equal, &done); |
| 942 __ movq(result, FieldOperand(input, JSValue::kValueOffset)); |
| 943 |
| 944 __ bind(&done); |
933 } | 945 } |
934 | 946 |
935 | 947 |
936 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 948 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
937 LOperand* input = instr->InputAt(0); | 949 LOperand* input = instr->InputAt(0); |
938 ASSERT(input->Equals(instr->result())); | 950 ASSERT(input->Equals(instr->result())); |
939 __ not_(ToRegister(input)); | 951 __ not_(ToRegister(input)); |
940 } | 952 } |
941 | 953 |
942 | 954 |
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 RegisterEnvironmentForDeoptimization(environment); | 2855 RegisterEnvironmentForDeoptimization(environment); |
2844 ASSERT(osr_pc_offset_ == -1); | 2856 ASSERT(osr_pc_offset_ == -1); |
2845 osr_pc_offset_ = masm()->pc_offset(); | 2857 osr_pc_offset_ = masm()->pc_offset(); |
2846 } | 2858 } |
2847 | 2859 |
2848 #undef __ | 2860 #undef __ |
2849 | 2861 |
2850 } } // namespace v8::internal | 2862 } } // namespace v8::internal |
2851 | 2863 |
2852 #endif // V8_TARGET_ARCH_X64 | 2864 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |