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

Side by Side Diff: src/ic/x64/ic-compiler-x64.cc

Issue 486213003: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 3 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/ic/x64/handler-compiler-x64.cc ('k') | src/ic/x64/ic-conventions-x64.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/ic/ic-compiler.h" 9 #include "src/ic/ic-compiler.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 #define __ ACCESS_MASM(masm) 14 #define __ ACCESS_MASM(masm)
15 15
16 16
17 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, 17 void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
18 StrictMode strict_mode) { 18 StrictMode strict_mode) {
19 // Return address is on the stack. 19 // Return address is on the stack.
20 DCHECK(!rbx.is(StoreIC::ReceiverRegister()) && 20 DCHECK(!rbx.is(StoreConvention::ReceiverRegister()) &&
21 !rbx.is(StoreIC::NameRegister()) && !rbx.is(StoreIC::ValueRegister())); 21 !rbx.is(StoreConvention::NameRegister()) &&
22 !rbx.is(StoreConvention::ValueRegister()));
22 23
23 __ PopReturnAddressTo(rbx); 24 __ PopReturnAddressTo(rbx);
24 __ Push(StoreIC::ReceiverRegister()); 25 __ Push(StoreConvention::ReceiverRegister());
25 __ Push(StoreIC::NameRegister()); 26 __ Push(StoreConvention::NameRegister());
26 __ Push(StoreIC::ValueRegister()); 27 __ Push(StoreConvention::ValueRegister());
27 __ Push(Smi::FromInt(strict_mode)); 28 __ Push(Smi::FromInt(strict_mode));
28 __ PushReturnAddressFrom(rbx); 29 __ PushReturnAddressFrom(rbx);
29 30
30 // Do tail-call to runtime routine. 31 // Do tail-call to runtime routine.
31 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); 32 __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
32 } 33 }
33 34
34 35
35 #undef __ 36 #undef __
36 #define __ ACCESS_MASM(masm()) 37 #define __ ACCESS_MASM(masm())
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 88 }
88 } 89 }
89 90
90 Label number_case; 91 Label number_case;
91 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 92 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
92 __ JumpIfSmi(receiver(), smi_target); 93 __ JumpIfSmi(receiver(), smi_target);
93 94
94 // Polymorphic keyed stores may use the map register 95 // Polymorphic keyed stores may use the map register
95 Register map_reg = scratch1(); 96 Register map_reg = scratch1();
96 DCHECK(kind() != Code::KEYED_STORE_IC || 97 DCHECK(kind() != Code::KEYED_STORE_IC ||
97 map_reg.is(KeyedStoreIC::MapRegister())); 98 map_reg.is(StoreConvention::MapRegister()));
98 __ movp(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); 99 __ movp(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
99 int receiver_count = types->length(); 100 int receiver_count = types->length();
100 int number_of_handled_maps = 0; 101 int number_of_handled_maps = 0;
101 for (int current = 0; current < receiver_count; ++current) { 102 for (int current = 0; current < receiver_count; ++current) {
102 Handle<HeapType> type = types->at(current); 103 Handle<HeapType> type = types->at(current);
103 Handle<Map> map = IC::TypeToMap(*type, isolate()); 104 Handle<Map> map = IC::TypeToMap(*type, isolate());
104 if (!map->is_deprecated()) { 105 if (!map->is_deprecated()) {
105 number_of_handled_maps++; 106 number_of_handled_maps++;
106 // Check map and tail call if there's a match 107 // Check map and tail call if there's a match
107 __ Cmp(map_reg, map); 108 __ Cmp(map_reg, map);
(...skipping 14 matching lines...) Expand all
122 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; 123 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC;
123 return GetCode(kind(), type, name, state); 124 return GetCode(kind(), type, name, state);
124 } 125 }
125 126
126 127
127 #undef __ 128 #undef __
128 } 129 }
129 } // namespace v8::internal 130 } // namespace v8::internal
130 131
131 #endif // V8_TARGET_ARCH_X64 132 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/ic/x64/ic-conventions-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698