OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 } | 1235 } |
1236 | 1236 |
1237 | 1237 |
1238 #undef __ | 1238 #undef __ |
1239 #define __ ACCESS_MASM(masm) | 1239 #define __ ACCESS_MASM(masm) |
1240 | 1240 |
1241 | 1241 |
1242 void StoreStubCompiler::GenerateStoreViaSetter( | 1242 void StoreStubCompiler::GenerateStoreViaSetter( |
1243 MacroAssembler* masm, | 1243 MacroAssembler* masm, |
1244 Handle<HeapType> type, | 1244 Handle<HeapType> type, |
| 1245 Register receiver, |
1245 Handle<JSFunction> setter) { | 1246 Handle<JSFunction> setter) { |
1246 // ----------- S t a t e ------------- | 1247 // ----------- S t a t e ------------- |
1247 // -- a0 : value | |
1248 // -- a1 : receiver | |
1249 // -- a2 : name | |
1250 // -- ra : return address | 1248 // -- ra : return address |
1251 // ----------------------------------- | 1249 // ----------------------------------- |
1252 { | 1250 { |
1253 FrameScope scope(masm, StackFrame::INTERNAL); | 1251 FrameScope scope(masm, StackFrame::INTERNAL); |
1254 Register receiver = a1; | |
1255 Register value = a0; | |
1256 | 1252 |
1257 // Save value register, so we can restore it later. | 1253 // Save value register, so we can restore it later. |
1258 __ push(value); | 1254 __ push(value()); |
1259 | 1255 |
1260 if (!setter.is_null()) { | 1256 if (!setter.is_null()) { |
1261 // Call the JavaScript setter with receiver and value on the stack. | 1257 // Call the JavaScript setter with receiver and value on the stack. |
1262 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 1258 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
1263 // Swap in the global receiver. | 1259 // Swap in the global receiver. |
1264 __ lw(receiver, | 1260 __ lw(receiver, |
1265 FieldMemOperand( | 1261 FieldMemOperand( |
1266 receiver, JSGlobalObject::kGlobalReceiverOffset)); | 1262 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
1267 } | 1263 } |
1268 __ Push(receiver, value); | 1264 __ Push(receiver, value()); |
1269 ParameterCount actual(1); | 1265 ParameterCount actual(1); |
1270 ParameterCount expected(setter); | 1266 ParameterCount expected(setter); |
1271 __ InvokeFunction(setter, expected, actual, | 1267 __ InvokeFunction(setter, expected, actual, |
1272 CALL_FUNCTION, NullCallWrapper()); | 1268 CALL_FUNCTION, NullCallWrapper()); |
1273 } else { | 1269 } else { |
1274 // If we generate a global code snippet for deoptimization only, remember | 1270 // If we generate a global code snippet for deoptimization only, remember |
1275 // the place to continue after deoptimization. | 1271 // the place to continue after deoptimization. |
1276 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1272 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1277 } | 1273 } |
1278 | 1274 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 } | 1341 } |
1346 | 1342 |
1347 | 1343 |
1348 Register* KeyedLoadStubCompiler::registers() { | 1344 Register* KeyedLoadStubCompiler::registers() { |
1349 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1345 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1350 static Register registers[] = { a1, a0, a2, a3, t0, t1 }; | 1346 static Register registers[] = { a1, a0, a2, a3, t0, t1 }; |
1351 return registers; | 1347 return registers; |
1352 } | 1348 } |
1353 | 1349 |
1354 | 1350 |
| 1351 Register StoreStubCompiler::value() { |
| 1352 return a0; |
| 1353 } |
| 1354 |
| 1355 |
1355 Register* StoreStubCompiler::registers() { | 1356 Register* StoreStubCompiler::registers() { |
1356 // receiver, name, value, scratch1, scratch2, scratch3. | 1357 // receiver, name, scratch1, scratch2, scratch3. |
1357 static Register registers[] = { a1, a2, a0, a3, t0, t1 }; | 1358 static Register registers[] = { a1, a2, a3, t0, t1 }; |
1358 return registers; | 1359 return registers; |
1359 } | 1360 } |
1360 | 1361 |
1361 | 1362 |
1362 Register* KeyedStoreStubCompiler::registers() { | 1363 Register* KeyedStoreStubCompiler::registers() { |
1363 // receiver, name, value, scratch1, scratch2, scratch3. | 1364 // receiver, name, scratch1, scratch2, scratch3. |
1364 static Register registers[] = { a2, a1, a0, a3, t0, t1 }; | 1365 static Register registers[] = { a2, a1, a3, t0, t1 }; |
1365 return registers; | 1366 return registers; |
1366 } | 1367 } |
1367 | 1368 |
1368 | 1369 |
1369 #undef __ | 1370 #undef __ |
1370 #define __ ACCESS_MASM(masm) | 1371 #define __ ACCESS_MASM(masm) |
1371 | 1372 |
1372 | 1373 |
1373 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1374 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
1374 Handle<HeapType> type, | 1375 Handle<HeapType> type, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 // ----------------------------------- | 1572 // ----------------------------------- |
1572 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1573 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1573 } | 1574 } |
1574 | 1575 |
1575 | 1576 |
1576 #undef __ | 1577 #undef __ |
1577 | 1578 |
1578 } } // namespace v8::internal | 1579 } } // namespace v8::internal |
1579 | 1580 |
1580 #endif // V8_TARGET_ARCH_MIPS | 1581 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |