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

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

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
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
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::DoStoreGlobal(LStoreGlobal* instr) { 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
2050 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* 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 }
2048 // If the cell we are storing to contains the hole it could have 2060 // If the cell we are storing to contains the hole it could have
2049 // been deleted from the property dictionary. In that case, we need 2061 // been deleted from the property dictionary. In that case, we need
2050 // to update the property details in the property dictionary to mark 2062 // to update the property details in the property dictionary to mark
2051 // it as no longer deleted. We deoptimize in that case. 2063 // it as no longer deleted. We deoptimize in that case.
2052 __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); 2064 __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL);
2053 if (check_hole) { 2065 if (check_hole) {
2054 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex); 2066 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex);
2055 DeoptimizeIf(equal, instr->environment()); 2067 DeoptimizeIf(equal, instr->environment());
2056 } 2068 }
2057 __ movq(Operand(temp, 0), value); 2069 __ movq(Operand(temp, 0), value);
2058 } 2070 }
2059 2071
2060 2072
2073 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2074 ASSERT(ToRegister(instr->global_object()).is(rdx));
2075 ASSERT(ToRegister(instr->value()).is(rax));
2076
2077 __ Move(rcx, instr->name());
2078 Handle<Code> ic = isolate()->builtins()->StoreIC_Initialize();
2079 CallCode(ic, RelocInfo::CODE_TARGET_CONTEXT, instr);
2080 }
2081
2082
2061 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2083 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2062 Register context = ToRegister(instr->context()); 2084 Register context = ToRegister(instr->context());
2063 Register result = ToRegister(instr->result()); 2085 Register result = ToRegister(instr->result());
2064 __ movq(result, ContextOperand(context, instr->slot_index())); 2086 __ movq(result, ContextOperand(context, instr->slot_index()));
2065 } 2087 }
2066 2088
2067 2089
2068 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2090 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2069 Register context = ToRegister(instr->context()); 2091 Register context = ToRegister(instr->context());
2070 Register value = ToRegister(instr->value()); 2092 Register value = ToRegister(instr->value());
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 __ movsd(xmm0, left_reg); 2747 __ movsd(xmm0, left_reg);
2726 #ifdef _WIN64 2748 #ifdef _WIN64
2727 ASSERT(ToRegister(right).is(rdx)); 2749 ASSERT(ToRegister(right).is(rdx));
2728 #else 2750 #else
2729 ASSERT(ToRegister(right).is(rdi)); 2751 ASSERT(ToRegister(right).is(rdi));
2730 #endif 2752 #endif
2731 __ CallCFunction( 2753 __ CallCFunction(
2732 ExternalReference::power_double_int_function(isolate()), 2); 2754 ExternalReference::power_double_int_function(isolate()), 2);
2733 } else { 2755 } else {
2734 ASSERT(exponent_type.IsTagged()); 2756 ASSERT(exponent_type.IsTagged());
2735 CpuFeatures::Scope scope(SSE2);
2736 Register right_reg = ToRegister(right); 2757 Register right_reg = ToRegister(right);
2737 2758
2738 Label non_smi, call; 2759 Label non_smi, call;
2739 __ JumpIfNotSmi(right_reg, &non_smi); 2760 __ JumpIfNotSmi(right_reg, &non_smi);
2740 __ SmiToInteger32(right_reg, right_reg); 2761 __ SmiToInteger32(right_reg, right_reg);
2741 __ cvtlsi2sd(xmm1, right_reg); 2762 __ cvtlsi2sd(xmm1, right_reg);
2742 __ jmp(&call); 2763 __ jmp(&call);
2743 2764
2744 __ bind(&non_smi); 2765 __ bind(&non_smi);
2745 __ CmpObjectType(right_reg, HEAP_NUMBER_TYPE , kScratchRegister); 2766 __ CmpObjectType(right_reg, HEAP_NUMBER_TYPE , kScratchRegister);
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3940 RegisterEnvironmentForDeoptimization(environment); 3961 RegisterEnvironmentForDeoptimization(environment);
3941 ASSERT(osr_pc_offset_ == -1); 3962 ASSERT(osr_pc_offset_ == -1);
3942 osr_pc_offset_ = masm()->pc_offset(); 3963 osr_pc_offset_ = masm()->pc_offset();
3943 } 3964 }
3944 3965
3945 #undef __ 3966 #undef __
3946 3967
3947 } } // namespace v8::internal 3968 } } // namespace v8::internal
3948 3969
3949 #endif // V8_TARGET_ARCH_X64 3970 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « 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