| 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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 | 2008 |
| 2009 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 2009 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
| 2010 Register result = ToRegister(instr->result()); | 2010 Register result = ToRegister(instr->result()); |
| 2011 if (result.is(rax)) { | 2011 if (result.is(rax)) { |
| 2012 __ load_rax(instr->hydrogen()->cell().location(), | 2012 __ load_rax(instr->hydrogen()->cell().location(), |
| 2013 RelocInfo::GLOBAL_PROPERTY_CELL); | 2013 RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2014 } else { | 2014 } else { |
| 2015 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); | 2015 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2016 __ movq(result, Operand(result, 0)); | 2016 __ movq(result, Operand(result, 0)); |
| 2017 } | 2017 } |
| 2018 if (instr->hydrogen()->check_hole_value()) { | 2018 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2019 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2019 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 2020 DeoptimizeIf(equal, instr->environment()); | 2020 DeoptimizeIf(equal, instr->environment()); |
| 2021 } | 2021 } |
| 2022 } | 2022 } |
| 2023 | 2023 |
| 2024 | 2024 |
| 2025 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 2025 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2026 ASSERT(ToRegister(instr->global_object()).is(rax)); | 2026 ASSERT(ToRegister(instr->global_object()).is(rax)); |
| 2027 ASSERT(ToRegister(instr->result()).is(rax)); | 2027 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2028 | 2028 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2040 Register value = ToRegister(instr->InputAt(0)); | 2040 Register value = ToRegister(instr->InputAt(0)); |
| 2041 ASSERT(!value.is(object)); | 2041 ASSERT(!value.is(object)); |
| 2042 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); | 2042 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); |
| 2043 | 2043 |
| 2044 __ movq(address, cell_handle, RelocInfo::GLOBAL_PROPERTY_CELL); | 2044 __ movq(address, cell_handle, RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2045 | 2045 |
| 2046 // If the cell we are storing to contains the hole it could have | 2046 // If the cell we are storing to contains the hole it could have |
| 2047 // been deleted from the property dictionary. In that case, we need | 2047 // been deleted from the property dictionary. In that case, we need |
| 2048 // to update the property details in the property dictionary to mark | 2048 // to update the property details in the property dictionary to mark |
| 2049 // it as no longer deleted. We deoptimize in that case. | 2049 // it as no longer deleted. We deoptimize in that case. |
| 2050 if (instr->hydrogen()->check_hole_value()) { | 2050 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2051 __ CompareRoot(Operand(address, 0), Heap::kTheHoleValueRootIndex); | 2051 __ CompareRoot(Operand(address, 0), Heap::kTheHoleValueRootIndex); |
| 2052 DeoptimizeIf(equal, instr->environment()); | 2052 DeoptimizeIf(equal, instr->environment()); |
| 2053 } | 2053 } |
| 2054 | 2054 |
| 2055 // Store the value. | 2055 // Store the value. |
| 2056 __ movq(Operand(address, 0), value); | 2056 __ movq(Operand(address, 0), value); |
| 2057 | 2057 |
| 2058 Label smi_store; | 2058 Label smi_store; |
| 2059 __ JumpIfSmi(value, &smi_store, Label::kNear); | 2059 __ JumpIfSmi(value, &smi_store, Label::kNear); |
| 2060 | 2060 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 2309 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 2310 DeoptimizeIf(equal, instr->environment()); | 2310 DeoptimizeIf(equal, instr->environment()); |
| 2311 } | 2311 } |
| 2312 } | 2312 } |
| 2313 | 2313 |
| 2314 | 2314 |
| 2315 void LCodeGen::DoLoadKeyedFastDoubleElement( | 2315 void LCodeGen::DoLoadKeyedFastDoubleElement( |
| 2316 LLoadKeyedFastDoubleElement* instr) { | 2316 LLoadKeyedFastDoubleElement* instr) { |
| 2317 XMMRegister result(ToDoubleRegister(instr->result())); | 2317 XMMRegister result(ToDoubleRegister(instr->result())); |
| 2318 | 2318 |
| 2319 if (instr->hydrogen()->RequiresHoleCheck()) { | 2319 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + |
| 2320 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + | 2320 sizeof(kHoleNanLower32); |
| 2321 sizeof(kHoleNanLower32); | 2321 Operand hole_check_operand = BuildFastArrayOperand( |
| 2322 Operand hole_check_operand = BuildFastArrayOperand( | 2322 instr->elements(), |
| 2323 instr->elements(), | 2323 instr->key(), |
| 2324 instr->key(), | 2324 FAST_DOUBLE_ELEMENTS, |
| 2325 FAST_DOUBLE_ELEMENTS, | 2325 offset); |
| 2326 offset); | 2326 __ cmpl(hole_check_operand, Immediate(kHoleNanUpper32)); |
| 2327 __ cmpl(hole_check_operand, Immediate(kHoleNanUpper32)); | 2327 DeoptimizeIf(equal, instr->environment()); |
| 2328 DeoptimizeIf(equal, instr->environment()); | |
| 2329 } | |
| 2330 | 2328 |
| 2331 Operand double_load_operand = BuildFastArrayOperand( | 2329 Operand double_load_operand = BuildFastArrayOperand( |
| 2332 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, | 2330 instr->elements(), instr->key(), FAST_DOUBLE_ELEMENTS, |
| 2333 FixedDoubleArray::kHeaderSize - kHeapObjectTag); | 2331 FixedDoubleArray::kHeaderSize - kHeapObjectTag); |
| 2334 __ movsd(result, double_load_operand); | 2332 __ movsd(result, double_load_operand); |
| 2335 } | 2333 } |
| 2336 | 2334 |
| 2337 | 2335 |
| 2338 Operand LCodeGen::BuildFastArrayOperand( | 2336 Operand LCodeGen::BuildFastArrayOperand( |
| 2339 LOperand* elements_pointer, | 2337 LOperand* elements_pointer, |
| (...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4198 RegisterEnvironmentForDeoptimization(environment); | 4196 RegisterEnvironmentForDeoptimization(environment); |
| 4199 ASSERT(osr_pc_offset_ == -1); | 4197 ASSERT(osr_pc_offset_ == -1); |
| 4200 osr_pc_offset_ = masm()->pc_offset(); | 4198 osr_pc_offset_ = masm()->pc_offset(); |
| 4201 } | 4199 } |
| 4202 | 4200 |
| 4203 #undef __ | 4201 #undef __ |
| 4204 | 4202 |
| 4205 } } // namespace v8::internal | 4203 } } // namespace v8::internal |
| 4206 | 4204 |
| 4207 #endif // V8_TARGET_ARCH_X64 | 4205 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |