OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 | 1137 |
1138 __ bind(&miss); | 1138 __ bind(&miss); |
1139 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1); | 1139 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1); |
1140 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1140 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1141 | 1141 |
1142 // Return the generated code. | 1142 // Return the generated code. |
1143 return GetCode(NORMAL, name); | 1143 return GetCode(NORMAL, name); |
1144 } | 1144 } |
1145 | 1145 |
1146 | 1146 |
| 1147 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, |
| 1148 JSObject* receiver, |
| 1149 JSObject* holder, |
| 1150 AccessorInfo* callback) { |
| 1151 // ----------- S t a t e ------------- |
| 1152 // -- rsp[0] : return address |
| 1153 // -- rsp[8] : name |
| 1154 // -- rsp[16] : receiver |
| 1155 // ----------------------------------- |
| 1156 Label miss; |
| 1157 |
| 1158 __ movq(rax, Operand(rsp, kPointerSize)); |
| 1159 __ movq(rcx, Operand(rsp, 2 * kPointerSize)); |
| 1160 __ IncrementCounter(&Counters::keyed_load_callback, 1); |
| 1161 |
| 1162 // Check that the name has not changed. |
| 1163 __ Cmp(rax, Handle<String>(name)); |
| 1164 __ j(not_equal, &miss); |
| 1165 |
| 1166 GenerateLoadCallback(receiver, holder, rcx, rax, rbx, rdx, |
| 1167 callback, name, &miss); |
| 1168 __ bind(&miss); |
| 1169 __ DecrementCounter(&Counters::keyed_load_callback, 1); |
| 1170 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1171 |
| 1172 // Return the generated code. |
| 1173 return GetCode(CALLBACKS, name); |
| 1174 } |
| 1175 |
| 1176 |
1147 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { | 1177 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { |
1148 // ----------- S t a t e ------------- | 1178 // ----------- S t a t e ------------- |
1149 // -- rsp[0] : return address | 1179 // -- rsp[0] : return address |
1150 // -- rsp[8] : name | 1180 // -- rsp[8] : name |
1151 // -- rsp[16] : receiver | 1181 // -- rsp[16] : receiver |
1152 // ----------------------------------- | 1182 // ----------------------------------- |
1153 Label miss; | 1183 Label miss; |
1154 | 1184 |
1155 __ movq(rax, Operand(rsp, kPointerSize)); | 1185 __ movq(rax, Operand(rsp, kPointerSize)); |
1156 __ movq(rcx, Operand(rsp, 2 * kPointerSize)); | 1186 __ movq(rcx, Operand(rsp, 2 * kPointerSize)); |
1157 __ IncrementCounter(&Counters::keyed_load_array_length, 1); | 1187 __ IncrementCounter(&Counters::keyed_load_array_length, 1); |
1158 | 1188 |
1159 // Check that the name has not changed. | 1189 // Check that the name has not changed. |
1160 __ Cmp(rax, Handle<String>(name)); | 1190 __ Cmp(rax, Handle<String>(name)); |
1161 __ j(not_equal, &miss); | 1191 __ j(not_equal, &miss); |
1162 | 1192 |
1163 GenerateLoadArrayLength(masm(), rcx, rdx, &miss); | 1193 GenerateLoadArrayLength(masm(), rcx, rdx, &miss); |
1164 __ bind(&miss); | 1194 __ bind(&miss); |
1165 __ DecrementCounter(&Counters::keyed_load_array_length, 1); | 1195 __ DecrementCounter(&Counters::keyed_load_array_length, 1); |
1166 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1196 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1167 | 1197 |
1168 // Return the generated code. | 1198 // Return the generated code. |
1169 return GetCode(CALLBACKS, name); | 1199 return GetCode(CALLBACKS, name); |
1170 } | 1200 } |
1171 | 1201 |
1172 | 1202 |
1173 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, | |
1174 JSObject* object, | |
1175 JSObject* holder, | |
1176 AccessorInfo* callback) { | |
1177 UNIMPLEMENTED(); | |
1178 return NULL; | |
1179 } | |
1180 | |
1181 | |
1182 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 1203 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
1183 JSObject* receiver, | 1204 JSObject* receiver, |
1184 JSObject* holder, | 1205 JSObject* holder, |
1185 Object* value) { | 1206 Object* value) { |
1186 // ----------- S t a t e ------------- | 1207 // ----------- S t a t e ------------- |
1187 // -- rsp[0] : return address | 1208 // -- rsp[0] : return address |
1188 // -- rsp[8] : name | 1209 // -- rsp[8] : name |
1189 // -- rsp[16] : receiver | 1210 // -- rsp[16] : receiver |
1190 // ----------------------------------- | 1211 // ----------------------------------- |
1191 Label miss; | 1212 Label miss; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 | 1734 |
1714 // Return the constant value. | 1735 // Return the constant value. |
1715 __ Move(rax, Handle<Object>(value)); | 1736 __ Move(rax, Handle<Object>(value)); |
1716 __ ret(0); | 1737 __ ret(0); |
1717 } | 1738 } |
1718 | 1739 |
1719 | 1740 |
1720 #undef __ | 1741 #undef __ |
1721 | 1742 |
1722 } } // namespace v8::internal | 1743 } } // namespace v8::internal |
OLD | NEW |