Chromium Code Reviews| 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 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2014 __ push(eax); | 2014 __ push(eax); |
| 2015 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 2015 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 2016 __ CallRuntime(Runtime::kTraceExit, 1); | 2016 __ CallRuntime(Runtime::kTraceExit, 1); |
| 2017 } | 2017 } |
| 2018 __ mov(esp, ebp); | 2018 __ mov(esp, ebp); |
| 2019 __ pop(ebp); | 2019 __ pop(ebp); |
| 2020 __ Ret((ParameterCount() + 1) * kPointerSize, ecx); | 2020 __ Ret((ParameterCount() + 1) * kPointerSize, ecx); |
| 2021 } | 2021 } |
| 2022 | 2022 |
| 2023 | 2023 |
| 2024 void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { | 2024 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
| 2025 Register result = ToRegister(instr->result()); | 2025 Register result = ToRegister(instr->result()); |
| 2026 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); | 2026 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); |
| 2027 if (instr->hydrogen()->check_hole_value()) { | 2027 if (instr->hydrogen()->check_hole_value()) { |
| 2028 __ cmp(result, Factory::the_hole_value()); | 2028 __ cmp(result, Factory::the_hole_value()); |
| 2029 DeoptimizeIf(equal, instr->environment()); | 2029 DeoptimizeIf(equal, instr->environment()); |
| 2030 } | 2030 } |
| 2031 } | 2031 } |
| 2032 | 2032 |
| 2033 | 2033 |
| 2034 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | |
| 2035 ASSERT(ToRegister(instr->context()).is(esi)); | |
| 2036 ASSERT(ToRegister(instr->result()).is(eax)); | |
| 2037 | |
| 2038 __ mov(eax, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | |
|
fschneider
2011/03/16 10:28:18
You could consider making LoadGlobalGeneric take t
Søren Thygesen Gjesse
2011/03/17 07:52:27
Done.
| |
| 2039 __ mov(ecx, instr->name()); | |
| 2040 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : | |
| 2041 RelocInfo::CODE_TARGET_CONTEXT; | |
| 2042 Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize)); | |
| 2043 CallCode(ic, mode, instr); | |
| 2044 } | |
| 2045 | |
| 2046 | |
| 2034 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 2047 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
| 2035 Register value = ToRegister(instr->InputAt(0)); | 2048 Register value = ToRegister(instr->InputAt(0)); |
| 2036 Operand cell_operand = Operand::Cell(instr->hydrogen()->cell()); | 2049 Operand cell_operand = Operand::Cell(instr->hydrogen()->cell()); |
| 2037 | 2050 |
| 2038 // If the cell we are storing to contains the hole it could have | 2051 // If the cell we are storing to contains the hole it could have |
| 2039 // been deleted from the property dictionary. In that case, we need | 2052 // been deleted from the property dictionary. In that case, we need |
| 2040 // to update the property details in the property dictionary to mark | 2053 // to update the property details in the property dictionary to mark |
| 2041 // it as no longer deleted. We deoptimize in that case. | 2054 // it as no longer deleted. We deoptimize in that case. |
| 2042 if (instr->hydrogen()->check_hole_value()) { | 2055 if (instr->hydrogen()->check_hole_value()) { |
| 2043 __ cmp(cell_operand, Factory::the_hole_value()); | 2056 __ cmp(cell_operand, Factory::the_hole_value()); |
| (...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3938 ASSERT(osr_pc_offset_ == -1); | 3951 ASSERT(osr_pc_offset_ == -1); |
| 3939 osr_pc_offset_ = masm()->pc_offset(); | 3952 osr_pc_offset_ = masm()->pc_offset(); |
| 3940 } | 3953 } |
| 3941 | 3954 |
| 3942 | 3955 |
| 3943 #undef __ | 3956 #undef __ |
| 3944 | 3957 |
| 3945 } } // namespace v8::internal | 3958 } } // namespace v8::internal |
| 3946 | 3959 |
| 3947 #endif // V8_TARGET_ARCH_IA32 | 3960 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |