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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 } | 1249 } |
1250 | 1250 |
1251 | 1251 |
1252 #undef __ | 1252 #undef __ |
1253 #define __ ACCESS_MASM(masm) | 1253 #define __ ACCESS_MASM(masm) |
1254 | 1254 |
1255 | 1255 |
1256 void StoreStubCompiler::GenerateStoreViaSetter( | 1256 void StoreStubCompiler::GenerateStoreViaSetter( |
1257 MacroAssembler* masm, | 1257 MacroAssembler* masm, |
1258 Handle<HeapType> type, | 1258 Handle<HeapType> type, |
| 1259 Register receiver, |
1259 Handle<JSFunction> setter) { | 1260 Handle<JSFunction> setter) { |
1260 // ----------- S t a t e ------------- | 1261 // ----------- S t a t e ------------- |
1261 // -- r0 : value | |
1262 // -- r1 : receiver | |
1263 // -- r2 : name | |
1264 // -- lr : return address | 1262 // -- lr : return address |
1265 // ----------------------------------- | 1263 // ----------------------------------- |
1266 { | 1264 { |
1267 FrameScope scope(masm, StackFrame::INTERNAL); | 1265 FrameScope scope(masm, StackFrame::INTERNAL); |
1268 Register receiver = r1; | |
1269 Register value = r0; | |
1270 | 1266 |
1271 // Save value register, so we can restore it later. | 1267 // Save value register, so we can restore it later. |
1272 __ push(value); | 1268 __ push(value()); |
1273 | 1269 |
1274 if (!setter.is_null()) { | 1270 if (!setter.is_null()) { |
1275 // Call the JavaScript setter with receiver and value on the stack. | 1271 // Call the JavaScript setter with receiver and value on the stack. |
1276 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 1272 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
1277 // Swap in the global receiver. | 1273 // Swap in the global receiver. |
1278 __ ldr(receiver, | 1274 __ ldr(receiver, |
1279 FieldMemOperand( | 1275 FieldMemOperand( |
1280 receiver, JSGlobalObject::kGlobalReceiverOffset)); | 1276 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
1281 } | 1277 } |
1282 __ Push(receiver, value); | 1278 __ Push(receiver, value()); |
1283 ParameterCount actual(1); | 1279 ParameterCount actual(1); |
1284 ParameterCount expected(setter); | 1280 ParameterCount expected(setter); |
1285 __ InvokeFunction(setter, expected, actual, | 1281 __ InvokeFunction(setter, expected, actual, |
1286 CALL_FUNCTION, NullCallWrapper()); | 1282 CALL_FUNCTION, NullCallWrapper()); |
1287 } else { | 1283 } else { |
1288 // If we generate a global code snippet for deoptimization only, remember | 1284 // If we generate a global code snippet for deoptimization only, remember |
1289 // the place to continue after deoptimization. | 1285 // the place to continue after deoptimization. |
1290 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1286 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1291 } | 1287 } |
1292 | 1288 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 } | 1356 } |
1361 | 1357 |
1362 | 1358 |
1363 Register* KeyedLoadStubCompiler::registers() { | 1359 Register* KeyedLoadStubCompiler::registers() { |
1364 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1360 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1365 static Register registers[] = { r1, r0, r2, r3, r4, r5 }; | 1361 static Register registers[] = { r1, r0, r2, r3, r4, r5 }; |
1366 return registers; | 1362 return registers; |
1367 } | 1363 } |
1368 | 1364 |
1369 | 1365 |
| 1366 Register StoreStubCompiler::value() { |
| 1367 return r0; |
| 1368 } |
| 1369 |
| 1370 |
1370 Register* StoreStubCompiler::registers() { | 1371 Register* StoreStubCompiler::registers() { |
1371 // receiver, name, value, scratch1, scratch2, scratch3. | 1372 // receiver, name, scratch1, scratch2, scratch3. |
1372 static Register registers[] = { r1, r2, r0, r3, r4, r5 }; | 1373 static Register registers[] = { r1, r2, r3, r4, r5 }; |
1373 return registers; | 1374 return registers; |
1374 } | 1375 } |
1375 | 1376 |
1376 | 1377 |
1377 Register* KeyedStoreStubCompiler::registers() { | 1378 Register* KeyedStoreStubCompiler::registers() { |
1378 // receiver, name, value, scratch1, scratch2, scratch3. | 1379 // receiver, name, scratch1, scratch2, scratch3. |
1379 static Register registers[] = { r2, r1, r0, r3, r4, r5 }; | 1380 static Register registers[] = { r2, r1, r3, r4, r5 }; |
1380 return registers; | 1381 return registers; |
1381 } | 1382 } |
1382 | 1383 |
1383 | 1384 |
1384 #undef __ | 1385 #undef __ |
1385 #define __ ACCESS_MASM(masm) | 1386 #define __ ACCESS_MASM(masm) |
1386 | 1387 |
1387 | 1388 |
1388 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1389 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
1389 Handle<HeapType> type, | 1390 Handle<HeapType> type, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 // ----------------------------------- | 1584 // ----------------------------------- |
1584 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1585 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1585 } | 1586 } |
1586 | 1587 |
1587 | 1588 |
1588 #undef __ | 1589 #undef __ |
1589 | 1590 |
1590 } } // namespace v8::internal | 1591 } } // namespace v8::internal |
1591 | 1592 |
1592 #endif // V8_TARGET_ARCH_ARM | 1593 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |