Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(546)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6758007: Increase coverage of global loads in optimized code (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 // call to return the value in the same register. 2012 // call to return the value in the same register.
2013 __ push(rax); 2013 __ push(rax);
2014 __ CallRuntime(Runtime::kTraceExit, 1); 2014 __ CallRuntime(Runtime::kTraceExit, 1);
2015 } 2015 }
2016 __ movq(rsp, rbp); 2016 __ movq(rsp, rbp);
2017 __ pop(rbp); 2017 __ pop(rbp);
2018 __ Ret((ParameterCount() + 1) * kPointerSize, rcx); 2018 __ Ret((ParameterCount() + 1) * kPointerSize, rcx);
2019 } 2019 }
2020 2020
2021 2021
2022 void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { 2022 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2023 Register result = ToRegister(instr->result()); 2023 Register result = ToRegister(instr->result());
2024 if (result.is(rax)) { 2024 if (result.is(rax)) {
2025 __ load_rax(instr->hydrogen()->cell().location(), 2025 __ load_rax(instr->hydrogen()->cell().location(),
2026 RelocInfo::GLOBAL_PROPERTY_CELL); 2026 RelocInfo::GLOBAL_PROPERTY_CELL);
2027 } else { 2027 } else {
2028 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); 2028 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL);
2029 __ movq(result, Operand(result, 0)); 2029 __ movq(result, Operand(result, 0));
2030 } 2030 }
2031 if (instr->hydrogen()->check_hole_value()) { 2031 if (instr->hydrogen()->check_hole_value()) {
2032 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 2032 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
2033 DeoptimizeIf(equal, instr->environment()); 2033 DeoptimizeIf(equal, instr->environment());
2034 } 2034 }
2035 } 2035 }
2036 2036
2037 2037
2038 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2039 ASSERT(ToRegister(instr->global_object()).is(rax));
2040 ASSERT(ToRegister(instr->result()).is(rax));
2041
2042 __ Move(rcx, instr->name());
2043 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET :
2044 RelocInfo::CODE_TARGET_CONTEXT;
2045 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2046 CallCode(ic, mode, instr);
2047 }
2048
2049
2038 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { 2050 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) {
2039 Register value = ToRegister(instr->InputAt(0)); 2051 Register value = ToRegister(instr->InputAt(0));
2040 Register temp = ToRegister(instr->TempAt(0)); 2052 Register temp = ToRegister(instr->TempAt(0));
2041 ASSERT(!value.is(temp)); 2053 ASSERT(!value.is(temp));
2042 bool check_hole = instr->hydrogen()->check_hole_value(); 2054 bool check_hole = instr->hydrogen()->check_hole_value();
2043 if (!check_hole && value.is(rax)) { 2055 if (!check_hole && value.is(rax)) {
2044 __ store_rax(instr->hydrogen()->cell().location(), 2056 __ store_rax(instr->hydrogen()->cell().location(),
2045 RelocInfo::GLOBAL_PROPERTY_CELL); 2057 RelocInfo::GLOBAL_PROPERTY_CELL);
2046 return; 2058 return;
2047 } 2059 }
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3940 RegisterEnvironmentForDeoptimization(environment); 3952 RegisterEnvironmentForDeoptimization(environment);
3941 ASSERT(osr_pc_offset_ == -1); 3953 ASSERT(osr_pc_offset_ == -1);
3942 osr_pc_offset_ = masm()->pc_offset(); 3954 osr_pc_offset_ = masm()->pc_offset();
3943 } 3955 }
3944 3956
3945 #undef __ 3957 #undef __
3946 3958
3947 } } // namespace v8::internal 3959 } } // namespace v8::internal
3948 3960
3949 #endif // V8_TARGET_ARCH_X64 3961 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ast.cc ('K') | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698