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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 } | 976 } |
977 | 977 |
978 | 978 |
979 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 979 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
980 Register result = ToRegister(instr->result()); | 980 Register result = ToRegister(instr->result()); |
981 Register array = ToRegister(instr->InputAt(0)); | 981 Register array = ToRegister(instr->InputAt(0)); |
982 __ mov(result, FieldOperand(array, FixedArray::kLengthOffset)); | 982 __ mov(result, FieldOperand(array, FixedArray::kLengthOffset)); |
983 } | 983 } |
984 | 984 |
985 | 985 |
| 986 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { |
| 987 Register result = ToRegister(instr->result()); |
| 988 Register array = ToRegister(instr->InputAt(0)); |
| 989 __ mov(result, FieldOperand(array, PixelArray::kLengthOffset)); |
| 990 } |
| 991 |
| 992 |
986 void LCodeGen::DoValueOf(LValueOf* instr) { | 993 void LCodeGen::DoValueOf(LValueOf* instr) { |
987 Register input = ToRegister(instr->InputAt(0)); | 994 Register input = ToRegister(instr->InputAt(0)); |
988 Register result = ToRegister(instr->result()); | 995 Register result = ToRegister(instr->result()); |
989 Register map = ToRegister(instr->TempAt(0)); | 996 Register map = ToRegister(instr->TempAt(0)); |
990 ASSERT(input.is(result)); | 997 ASSERT(input.is(result)); |
991 NearLabel done; | 998 NearLabel done; |
992 // If the object is a smi return the object. | 999 // If the object is a smi return the object. |
993 __ test(input, Immediate(kSmiTagMask)); | 1000 __ test(input, Immediate(kSmiTagMask)); |
994 __ j(zero, &done); | 1001 __ j(zero, &done); |
995 | 1002 |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 2006 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
2000 ASSERT(instr->result()->Equals(instr->InputAt(0))); | 2007 ASSERT(instr->result()->Equals(instr->InputAt(0))); |
2001 Register reg = ToRegister(instr->InputAt(0)); | 2008 Register reg = ToRegister(instr->InputAt(0)); |
2002 __ mov(reg, FieldOperand(reg, JSObject::kElementsOffset)); | 2009 __ mov(reg, FieldOperand(reg, JSObject::kElementsOffset)); |
2003 if (FLAG_debug_code) { | 2010 if (FLAG_debug_code) { |
2004 NearLabel done; | 2011 NearLabel done; |
2005 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2012 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2006 Immediate(Factory::fixed_array_map())); | 2013 Immediate(Factory::fixed_array_map())); |
2007 __ j(equal, &done); | 2014 __ j(equal, &done); |
2008 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), | 2015 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
| 2016 Immediate(Factory::pixel_array_map())); |
| 2017 __ j(equal, &done); |
| 2018 __ cmp(FieldOperand(reg, HeapObject::kMapOffset), |
2009 Immediate(Factory::fixed_cow_array_map())); | 2019 Immediate(Factory::fixed_cow_array_map())); |
2010 __ Check(equal, "Check for fast elements failed."); | 2020 __ Check(equal, "Check for fast elements or pixel array failed."); |
2011 __ bind(&done); | 2021 __ bind(&done); |
2012 } | 2022 } |
2013 } | 2023 } |
2014 | 2024 |
2015 | 2025 |
| 2026 void LCodeGen::DoLoadPixelArrayExternalPointer( |
| 2027 LLoadPixelArrayExternalPointer* instr) { |
| 2028 ASSERT(instr->result()->Equals(instr->InputAt(0))); |
| 2029 Register reg = ToRegister(instr->InputAt(0)); |
| 2030 __ mov(reg, FieldOperand(reg, PixelArray::kExternalPointerOffset)); |
| 2031 } |
| 2032 |
| 2033 |
2016 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2034 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
2017 Register arguments = ToRegister(instr->arguments()); | 2035 Register arguments = ToRegister(instr->arguments()); |
2018 Register length = ToRegister(instr->length()); | 2036 Register length = ToRegister(instr->length()); |
2019 Operand index = ToOperand(instr->index()); | 2037 Operand index = ToOperand(instr->index()); |
2020 Register result = ToRegister(instr->result()); | 2038 Register result = ToRegister(instr->result()); |
2021 | 2039 |
2022 __ sub(length, index); | 2040 __ sub(length, index); |
2023 DeoptimizeIf(below_equal, instr->environment()); | 2041 DeoptimizeIf(below_equal, instr->environment()); |
2024 | 2042 |
2025 // There are two words between the frame pointer and the last argument. | 2043 // There are two words between the frame pointer and the last argument. |
(...skipping 10 matching lines...) Expand all Loading... |
2036 | 2054 |
2037 // Load the result. | 2055 // Load the result. |
2038 __ mov(result, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); | 2056 __ mov(result, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); |
2039 | 2057 |
2040 // Check for the hole value. | 2058 // Check for the hole value. |
2041 __ cmp(result, Factory::the_hole_value()); | 2059 __ cmp(result, Factory::the_hole_value()); |
2042 DeoptimizeIf(equal, instr->environment()); | 2060 DeoptimizeIf(equal, instr->environment()); |
2043 } | 2061 } |
2044 | 2062 |
2045 | 2063 |
| 2064 void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) { |
| 2065 Register external_elements = ToRegister(instr->external_pointer()); |
| 2066 Register key = ToRegister(instr->key()); |
| 2067 Register result = ToRegister(instr->result()); |
| 2068 ASSERT(result.is(external_elements)); |
| 2069 |
| 2070 // Load the result. |
| 2071 __ movzx_b(result, Operand(external_elements, key, times_1, 0)); |
| 2072 } |
| 2073 |
| 2074 |
2046 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2075 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
2047 ASSERT(ToRegister(instr->object()).is(edx)); | 2076 ASSERT(ToRegister(instr->object()).is(edx)); |
2048 ASSERT(ToRegister(instr->key()).is(eax)); | 2077 ASSERT(ToRegister(instr->key()).is(eax)); |
2049 | 2078 |
2050 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 2079 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
2051 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2080 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2052 } | 2081 } |
2053 | 2082 |
2054 | 2083 |
2055 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2084 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3637 ASSERT(osr_pc_offset_ == -1); | 3666 ASSERT(osr_pc_offset_ == -1); |
3638 osr_pc_offset_ = masm()->pc_offset(); | 3667 osr_pc_offset_ = masm()->pc_offset(); |
3639 } | 3668 } |
3640 | 3669 |
3641 | 3670 |
3642 #undef __ | 3671 #undef __ |
3643 | 3672 |
3644 } } // namespace v8::internal | 3673 } } // namespace v8::internal |
3645 | 3674 |
3646 #endif // V8_TARGET_ARCH_IA32 | 3675 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |