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

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

Issue 782273004: MIPS: Fix after 'Reland remaining parts of 'Use weak cells in map checks in polymorphic ICs''. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | src/ic/mips64/ic-compiler-mips64.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 int number_of_handled_maps = 0; 51 int number_of_handled_maps = 0;
52 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 52 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
53 for (int current = 0; current < receiver_count; ++current) { 53 for (int current = 0; current < receiver_count; ++current) {
54 Handle<HeapType> type = types->at(current); 54 Handle<HeapType> type = types->at(current);
55 Handle<Map> map = IC::TypeToMap(*type, isolate()); 55 Handle<Map> map = IC::TypeToMap(*type, isolate());
56 if (!map->is_deprecated()) { 56 if (!map->is_deprecated()) {
57 number_of_handled_maps++; 57 number_of_handled_maps++;
58 // Check map and tail call if there's a match. 58 // Check map and tail call if there's a match.
59 // Separate compare from branch, to provide path for above JumpIfSmi(). 59 // Separate compare from branch, to provide path for above JumpIfSmi().
60 Handle<WeakCell> cell = Map::WeakCellForMap(map); 60 Handle<WeakCell> cell = Map::WeakCellForMap(map);
61 __ CmpWeakValue(match, map_reg, cell); 61 __ GetWeakValue(match, cell);
62 if (type->Is(HeapType::Number())) { 62 if (type->Is(HeapType::Number())) {
63 DCHECK(!number_case.is_unused()); 63 DCHECK(!number_case.is_unused());
64 __ bind(&number_case); 64 __ bind(&number_case);
65 } 65 }
66 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq, match, 66 __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq, match,
67 Operand(zero_reg)); 67 Operand(map_reg));
68 } 68 }
69 } 69 }
70 DCHECK(number_of_handled_maps != 0); 70 DCHECK(number_of_handled_maps != 0);
71 71
72 __ bind(&miss); 72 __ bind(&miss);
73 TailCallBuiltin(masm(), MissBuiltin(kind())); 73 TailCallBuiltin(masm(), MissBuiltin(kind()));
74 74
75 // Return the generated code. 75 // Return the generated code.
76 InlineCacheState state = 76 InlineCacheState state =
77 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC; 77 number_of_handled_maps > 1 ? POLYMORPHIC : MONOMORPHIC;
78 return GetCode(kind(), type, name, state); 78 return GetCode(kind(), type, name, state);
79 } 79 }
80 80
81 81
82 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic( 82 Handle<Code> PropertyICCompiler::CompileKeyedStorePolymorphic(
83 MapHandleList* receiver_maps, CodeHandleList* handler_stubs, 83 MapHandleList* receiver_maps, CodeHandleList* handler_stubs,
84 MapHandleList* transitioned_maps) { 84 MapHandleList* transitioned_maps) {
85 Label miss; 85 Label miss;
86 __ JumpIfSmi(receiver(), &miss); 86 __ JumpIfSmi(receiver(), &miss);
87 87
88 int receiver_count = receiver_maps->length(); 88 int receiver_count = receiver_maps->length();
89 Register map_reg = scratch1(); 89 Register map_reg = scratch1();
90 Register match = scratch2(); 90 Register match = scratch2();
91 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); 91 __ lw(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
92 for (int i = 0; i < receiver_count; ++i) { 92 for (int i = 0; i < receiver_count; ++i) {
93 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_maps->at(i)); 93 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_maps->at(i));
94 __ CmpWeakValue(match, map_reg, cell); 94 __ GetWeakValue(match, cell);
95 if (transitioned_maps->at(i).is_null()) { 95 if (transitioned_maps->at(i).is_null()) {
96 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq, match, 96 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET, eq, match,
97 Operand(zero_reg)); 97 Operand(map_reg));
98 } else { 98 } else {
99 Label next_map; 99 Label next_map;
100 __ Branch(&next_map, ne, match, Operand(zero_reg)); 100 __ Branch(&next_map, ne, match, Operand(map_reg));
101 Handle<WeakCell> cell = Map::WeakCellForMap(transitioned_maps->at(i)); 101 Handle<WeakCell> cell = Map::WeakCellForMap(transitioned_maps->at(i));
102 __ LoadWeakValue(transition_map(), cell, &miss); 102 __ LoadWeakValue(transition_map(), cell, &miss);
103 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET); 103 __ Jump(handler_stubs->at(i), RelocInfo::CODE_TARGET);
104 __ bind(&next_map); 104 __ bind(&next_map);
105 } 105 }
106 } 106 }
107 107
108 __ bind(&miss); 108 __ bind(&miss);
109 TailCallBuiltin(masm(), MissBuiltin(kind())); 109 TailCallBuiltin(masm(), MissBuiltin(kind()));
110 110
(...skipping 17 matching lines...) Expand all
128 // Do tail-call to runtime routine. 128 // Do tail-call to runtime routine.
129 __ TailCallRuntime(Runtime::kSetProperty, 4, 1); 129 __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
130 } 130 }
131 131
132 132
133 #undef __ 133 #undef __
134 } 134 }
135 } // namespace v8::internal 135 } // namespace v8::internal
136 136
137 #endif // V8_TARGET_ARCH_MIPS 137 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/ic/mips64/ic-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698