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

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

Issue 571173003: PowerPC specific sub-directories (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 6 years, 1 month 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/ppc/handler-compiler-ppc.cc ('k') | src/ic/ppc/ic-ppc.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_ARM 7 #if V8_TARGET_ARCH_PPC
8 8
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/ic-compiler.h" 10 #include "src/ic/ic-compiler.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 #define __ ACCESS_MASM(masm) 15 #define __ ACCESS_MASM(masm)
16 16
17 17
(...skipping 21 matching lines...) Expand all
39 IcCheckType check) { 39 IcCheckType check) {
40 Label miss; 40 Label miss;
41 41
42 if (check == PROPERTY && 42 if (check == PROPERTY &&
43 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) { 43 (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
44 // In case we are compiling an IC for dictionary loads and stores, just 44 // In case we are compiling an IC for dictionary loads and stores, just
45 // check whether the name is unique. 45 // check whether the name is unique.
46 if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) { 46 if (name.is_identical_to(isolate()->factory()->normal_ic_symbol())) {
47 Register tmp = scratch1(); 47 Register tmp = scratch1();
48 __ JumpIfSmi(this->name(), &miss); 48 __ JumpIfSmi(this->name(), &miss);
49 __ ldr(tmp, FieldMemOperand(this->name(), HeapObject::kMapOffset)); 49 __ LoadP(tmp, FieldMemOperand(this->name(), HeapObject::kMapOffset));
50 __ ldrb(tmp, FieldMemOperand(tmp, Map::kInstanceTypeOffset)); 50 __ lbz(tmp, FieldMemOperand(tmp, Map::kInstanceTypeOffset));
51 __ JumpIfNotUniqueNameInstanceType(tmp, &miss); 51 __ JumpIfNotUniqueNameInstanceType(tmp, &miss);
52 } else { 52 } else {
53 __ cmp(this->name(), Operand(name)); 53 __ Cmpi(this->name(), Operand(name), r0);
54 __ b(ne, &miss); 54 __ bne(&miss);
55 } 55 }
56 } 56 }
57 57
58 Label number_case; 58 Label number_case;
59 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss; 59 Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
60 __ JumpIfSmi(receiver(), smi_target); 60 __ JumpIfSmi(receiver(), smi_target);
61 61
62 // Polymorphic keyed stores may use the map register 62 // Polymorphic keyed stores may use the map register
63 Register map_reg = scratch1(); 63 Register map_reg = scratch1();
64 DCHECK(kind() != Code::KEYED_STORE_IC || 64 DCHECK(kind() != Code::KEYED_STORE_IC ||
65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); 65 map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister()));
66 66
67 int receiver_count = types->length(); 67 int receiver_count = types->length();
68 int number_of_handled_maps = 0; 68 int number_of_handled_maps = 0;
69 __ ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 69 __ LoadP(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
70 for (int current = 0; current < receiver_count; ++current) { 70 for (int current = 0; current < receiver_count; ++current) {
71 Handle<HeapType> type = types->at(current); 71 Handle<HeapType> type = types->at(current);
72 Handle<Map> map = IC::TypeToMap(*type, isolate()); 72 Handle<Map> map = IC::TypeToMap(*type, isolate());
73 if (!map->is_deprecated()) { 73 if (!map->is_deprecated()) {
74 number_of_handled_maps++; 74 number_of_handled_maps++;
75 __ mov(ip, Operand(map)); 75 __ mov(ip, Operand(map));
76 __ cmp(map_reg, ip); 76 __ cmp(map_reg, ip);
77 if (type->Is(HeapType::Number())) { 77 if (type->Is(HeapType::Number())) {
78 DCHECK(!number_case.is_unused()); 78 DCHECK(!number_case.is_unused());
79 __ bind(&number_case); 79 __ bind(&number_case);
(...skipping 13 matching lines...) Expand all
93 } 93 }
94 94
95 95
96 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( 96 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic(
97 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, 97 MapHandleList* receiver_maps, CodeHandleList* handler_stubs,
98 MapHandleList* transitioned_maps) { 98 MapHandleList* transitioned_maps) {
99 Label miss; 99 Label miss;
100 __ JumpIfSmi(receiver(), &miss); 100 __ JumpIfSmi(receiver(), &miss);
101 101
102 int receiver_count = receiver_maps->length(); 102 int receiver_count = receiver_maps->length();
103 __ ldr(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); 103 __ LoadP(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset));
104 for (int i = 0; i < receiver_count; ++i) { 104 for (int i = 0; i < receiver_count; ++i) {
105 __ mov(ip, Operand(receiver_maps->at(i))); 105 __ mov(ip, Operand(receiver_maps->at(i)));
106 __ cmp(scratch1(), ip); 106 __ cmp(scratch1(), ip);
107 if (transitioned_maps->at(i).is_null()) { 107 if (transitioned_maps->at(i).is_null()) {
108 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq); 108 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq);
109 } else { 109 } else {
110 Label next_map; 110 Label next_map;
111 __ b(ne, &next_map); 111 __ bne(&next_map);
112 __ mov(transition_map(), Operand(transitioned_maps->at(i))); 112 __ mov(transition_map(), Operand(transitioned_maps->at(i)));
113 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, al); 113 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, al);
114 __ bind(&next_map); 114 __ bind(&next_map);
115 } 115 }
116 } 116 }
117 117
118 __ bind(&miss); 118 __ bind(&miss);
119 TailCallBuiltin(masm(), MissBuiltin(kind())); 119 TailCallBuiltin(masm(), MissBuiltin(kind()));
120 120
121 // Return the generated code. 121 // Return the generated code.
122 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 122 return GetCode(kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
123 } 123 }
124 124
125 125
126 #undef __ 126 #undef __
127 } 127 }
128 } // namespace v8::internal 128 } // namespace v8::internal
129 129
130 #endif // V8_TARGET_ARCH_ARM 130 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ic/ppc/handler-compiler-ppc.cc ('k') | src/ic/ppc/ic-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698