| 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::DoLoadGlobalCell(LLoadGlobalCell* instr) { | 1987 void LCodeGen::DoLoadGlobal(LLoadGlobal* 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->global_object()).is(rax)); | |
| 2005 ASSERT(ToRegister(instr->result()).is(rax)); | |
| 2006 | |
| 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 | |
| 2015 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 2003 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
| 2016 Register value = ToRegister(instr->InputAt(0)); | 2004 Register value = ToRegister(instr->InputAt(0)); |
| 2017 Register temp = ToRegister(instr->TempAt(0)); | 2005 Register temp = ToRegister(instr->TempAt(0)); |
| 2018 ASSERT(!value.is(temp)); | 2006 ASSERT(!value.is(temp)); |
| 2019 bool check_hole = instr->hydrogen()->check_hole_value(); | 2007 bool check_hole = instr->hydrogen()->check_hole_value(); |
| 2020 if (!check_hole && value.is(rax)) { | 2008 if (!check_hole && value.is(rax)) { |
| 2021 __ store_rax(instr->hydrogen()->cell().location(), | 2009 __ store_rax(instr->hydrogen()->cell().location(), |
| 2022 RelocInfo::GLOBAL_PROPERTY_CELL); | 2010 RelocInfo::GLOBAL_PROPERTY_CELL); |
| 2023 return; | 2011 return; |
| 2024 } | 2012 } |
| (...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3778 RegisterEnvironmentForDeoptimization(environment); | 3766 RegisterEnvironmentForDeoptimization(environment); |
| 3779 ASSERT(osr_pc_offset_ == -1); | 3767 ASSERT(osr_pc_offset_ == -1); |
| 3780 osr_pc_offset_ = masm()->pc_offset(); | 3768 osr_pc_offset_ = masm()->pc_offset(); |
| 3781 } | 3769 } |
| 3782 | 3770 |
| 3783 #undef __ | 3771 #undef __ |
| 3784 | 3772 |
| 3785 } } // namespace v8::internal | 3773 } } // namespace v8::internal |
| 3786 | 3774 |
| 3787 #endif // V8_TARGET_ARCH_X64 | 3775 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |