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

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

Issue 6693066: Extend crankshaft support for global stores (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments 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/ia32/lithium-ia32.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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 ASSERT(ToRegister(instr->result()).is(rax)); 2040 ASSERT(ToRegister(instr->result()).is(rax));
2041 2041
2042 __ Move(rcx, instr->name()); 2042 __ Move(rcx, instr->name());
2043 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET : 2043 RelocInfo::Mode mode = instr->for_typeof() ? RelocInfo::CODE_TARGET :
2044 RelocInfo::CODE_TARGET_CONTEXT; 2044 RelocInfo::CODE_TARGET_CONTEXT;
2045 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); 2045 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize();
2046 CallCode(ic, mode, instr); 2046 CallCode(ic, mode, instr);
2047 } 2047 }
2048 2048
2049 2049
2050 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { 2050 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
2051 Register value = ToRegister(instr->InputAt(0)); 2051 Register value = ToRegister(instr->InputAt(0));
2052 Register temp = ToRegister(instr->TempAt(0)); 2052 Register temp = ToRegister(instr->TempAt(0));
2053 ASSERT(!value.is(temp)); 2053 ASSERT(!value.is(temp));
2054 bool check_hole = instr->hydrogen()->check_hole_value(); 2054 bool check_hole = instr->hydrogen()->check_hole_value();
2055 if (!check_hole && value.is(rax)) { 2055 if (!check_hole && value.is(rax)) {
2056 __ store_rax(instr->hydrogen()->cell().location(), 2056 __ store_rax(instr->hydrogen()->cell().location(),
2057 RelocInfo::GLOBAL_PROPERTY_CELL); 2057 RelocInfo::GLOBAL_PROPERTY_CELL);
2058 return; 2058 return;
2059 } 2059 }
2060 // 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
2061 // been deleted from the property dictionary. In that case, we need 2061 // been deleted from the property dictionary. In that case, we need
2062 // to update the property details in the property dictionary to mark 2062 // to update the property details in the property dictionary to mark
2063 // it as no longer deleted. We deoptimize in that case. 2063 // it as no longer deleted. We deoptimize in that case.
2064 __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); 2064 __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL);
2065 if (check_hole) { 2065 if (check_hole) {
2066 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex); 2066 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex);
2067 DeoptimizeIf(equal, instr->environment()); 2067 DeoptimizeIf(equal, instr->environment());
2068 } 2068 }
2069 __ movq(Operand(temp, 0), value); 2069 __ movq(Operand(temp, 0), value);
2070 } 2070 }
2071 2071
2072 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
2073 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2083 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2074 Register context = ToRegister(instr->context()); 2084 Register context = ToRegister(instr->context());
2075 Register result = ToRegister(instr->result()); 2085 Register result = ToRegister(instr->result());
2076 __ movq(result, ContextOperand(context, instr->slot_index())); 2086 __ movq(result, ContextOperand(context, instr->slot_index()));
2077 } 2087 }
2078 2088
2079 2089
2080 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { 2090 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2081 Register context = ToRegister(instr->context()); 2091 Register context = ToRegister(instr->context());
2082 Register value = ToRegister(instr->value()); 2092 Register value = ToRegister(instr->value());
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 __ movsd(xmm0, left_reg); 2747 __ movsd(xmm0, left_reg);
2738 #ifdef _WIN64 2748 #ifdef _WIN64
2739 ASSERT(ToRegister(right).is(rdx)); 2749 ASSERT(ToRegister(right).is(rdx));
2740 #else 2750 #else
2741 ASSERT(ToRegister(right).is(rdi)); 2751 ASSERT(ToRegister(right).is(rdi));
2742 #endif 2752 #endif
2743 __ CallCFunction( 2753 __ CallCFunction(
2744 ExternalReference::power_double_int_function(isolate()), 2); 2754 ExternalReference::power_double_int_function(isolate()), 2);
2745 } else { 2755 } else {
2746 ASSERT(exponent_type.IsTagged()); 2756 ASSERT(exponent_type.IsTagged());
2747 CpuFeatures::Scope scope(SSE2);
2748 Register right_reg = ToRegister(right); 2757 Register right_reg = ToRegister(right);
2749 2758
2750 Label non_smi, call; 2759 Label non_smi, call;
2751 __ JumpIfNotSmi(right_reg, &non_smi); 2760 __ JumpIfNotSmi(right_reg, &non_smi);
2752 __ SmiToInteger32(right_reg, right_reg); 2761 __ SmiToInteger32(right_reg, right_reg);
2753 __ cvtlsi2sd(xmm1, right_reg); 2762 __ cvtlsi2sd(xmm1, right_reg);
2754 __ jmp(&call); 2763 __ jmp(&call);
2755 2764
2756 __ bind(&non_smi); 2765 __ bind(&non_smi);
2757 __ 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
3952 RegisterEnvironmentForDeoptimization(environment); 3961 RegisterEnvironmentForDeoptimization(environment);
3953 ASSERT(osr_pc_offset_ == -1); 3962 ASSERT(osr_pc_offset_ == -1);
3954 osr_pc_offset_ = masm()->pc_offset(); 3963 osr_pc_offset_ = masm()->pc_offset();
3955 } 3964 }
3956 3965
3957 #undef __ 3966 #undef __
3958 3967
3959 } } // namespace v8::internal 3968 } } // namespace v8::internal
3960 3969
3961 #endif // V8_TARGET_ARCH_X64 3970 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698