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 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1977 // call to return the value in the same register. | 1977 // call to return the value in the same register. |
1978 __ push(rax); | 1978 __ push(rax); |
1979 __ CallRuntime(Runtime::kTraceExit, 1); | 1979 __ CallRuntime(Runtime::kTraceExit, 1); |
1980 } | 1980 } |
1981 __ movq(rsp, rbp); | 1981 __ movq(rsp, rbp); |
1982 __ pop(rbp); | 1982 __ pop(rbp); |
1983 __ Ret((ParameterCount() + 1) * kPointerSize, rcx); | 1983 __ Ret((ParameterCount() + 1) * kPointerSize, rcx); |
1984 } | 1984 } |
1985 | 1985 |
1986 | 1986 |
1987 void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { | 1987 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
1988 Register result = ToRegister(instr->result()); | 1988 Register result = ToRegister(instr->result()); |
1989 if (result.is(rax)) { | 1989 if (result.is(rax)) { |
1990 __ load_rax(instr->hydrogen()->cell().location(), | 1990 __ load_rax(instr->hydrogen()->cell().location(), |
1991 RelocInfo::GLOBAL_PROPERTY_CELL); | 1991 RelocInfo::GLOBAL_PROPERTY_CELL); |
1992 } else { | 1992 } else { |
1993 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); | 1993 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); |
1994 __ movq(result, Operand(result, 0)); | 1994 __ movq(result, Operand(result, 0)); |
1995 } | 1995 } |
1996 if (instr->hydrogen()->check_hole_value()) { | 1996 if (instr->hydrogen()->check_hole_value()) { |
1997 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 1997 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
1998 DeoptimizeIf(equal, instr->environment()); | 1998 DeoptimizeIf(equal, instr->environment()); |
1999 } | 1999 } |
2000 } | 2000 } |
2001 | 2001 |
2002 | 2002 |
| 2003 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| 2004 ASSERT(ToRegister(instr->result()).is(rax)); |
| 2005 |
| 2006 __ movq(rax, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 2007 __ Move(rcx, instr->name()); |
| 2008 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : |
| 2009 RelocInfo::CODE_TARGET_CONTEXT; |
| 2010 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); |
| 2011 CallCode(ic, mode, instr); |
| 2012 } |
| 2013 |
| 2014 |
2003 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 2015 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
2004 Register value = ToRegister(instr->InputAt(0)); | 2016 Register value = ToRegister(instr->InputAt(0)); |
2005 Register temp = ToRegister(instr->TempAt(0)); | 2017 Register temp = ToRegister(instr->TempAt(0)); |
2006 ASSERT(!value.is(temp)); | 2018 ASSERT(!value.is(temp)); |
2007 bool check_hole = instr->hydrogen()->check_hole_value(); | 2019 bool check_hole = instr->hydrogen()->check_hole_value(); |
2008 if (!check_hole && value.is(rax)) { | 2020 if (!check_hole && value.is(rax)) { |
2009 __ store_rax(instr->hydrogen()->cell().location(), | 2021 __ store_rax(instr->hydrogen()->cell().location(), |
2010 RelocInfo::GLOBAL_PROPERTY_CELL); | 2022 RelocInfo::GLOBAL_PROPERTY_CELL); |
2011 return; | 2023 return; |
2012 } | 2024 } |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3763 RegisterEnvironmentForDeoptimization(environment); | 3775 RegisterEnvironmentForDeoptimization(environment); |
3764 ASSERT(osr_pc_offset_ == -1); | 3776 ASSERT(osr_pc_offset_ == -1); |
3765 osr_pc_offset_ = masm()->pc_offset(); | 3777 osr_pc_offset_ = masm()->pc_offset(); |
3766 } | 3778 } |
3767 | 3779 |
3768 #undef __ | 3780 #undef __ |
3769 | 3781 |
3770 } } // namespace v8::internal | 3782 } } // namespace v8::internal |
3771 | 3783 |
3772 #endif // V8_TARGET_ARCH_X64 | 3784 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |