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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 return GetCode(kind(), Code::FAST, name); | 1277 return GetCode(kind(), Code::FAST, name); |
1278 } | 1278 } |
1279 | 1279 |
1280 | 1280 |
1281 #undef __ | 1281 #undef __ |
1282 #define __ ACCESS_MASM(masm) | 1282 #define __ ACCESS_MASM(masm) |
1283 | 1283 |
1284 | 1284 |
1285 void StoreStubCompiler::GenerateStoreViaSetter( | 1285 void StoreStubCompiler::GenerateStoreViaSetter( |
1286 MacroAssembler* masm, | 1286 MacroAssembler* masm, |
| 1287 Handle<HeapType> type, |
1287 Handle<JSFunction> setter) { | 1288 Handle<JSFunction> setter) { |
1288 // ----------- S t a t e ------------- | 1289 // ----------- S t a t e ------------- |
1289 // -- r0 : value | 1290 // -- r0 : value |
1290 // -- r1 : receiver | 1291 // -- r1 : receiver |
1291 // -- r2 : name | 1292 // -- r2 : name |
1292 // -- lr : return address | 1293 // -- lr : return address |
1293 // ----------------------------------- | 1294 // ----------------------------------- |
1294 { | 1295 { |
1295 FrameScope scope(masm, StackFrame::INTERNAL); | 1296 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1297 Register receiver = r1; |
| 1298 Register value = r0; |
1296 | 1299 |
1297 // Save value register, so we can restore it later. | 1300 // Save value register, so we can restore it later. |
1298 __ push(r0); | 1301 __ push(value); |
1299 | 1302 |
1300 if (!setter.is_null()) { | 1303 if (!setter.is_null()) { |
1301 // Call the JavaScript setter with receiver and value on the stack. | 1304 // Call the JavaScript setter with receiver and value on the stack. |
1302 __ Push(r1, r0); | 1305 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
| 1306 // Swap in the global receiver. |
| 1307 __ ldr(receiver, |
| 1308 FieldMemOperand( |
| 1309 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
| 1310 } |
| 1311 __ Push(receiver, value); |
1303 ParameterCount actual(1); | 1312 ParameterCount actual(1); |
1304 ParameterCount expected(setter); | 1313 ParameterCount expected(setter); |
1305 __ InvokeFunction(setter, expected, actual, | 1314 __ InvokeFunction(setter, expected, actual, |
1306 CALL_FUNCTION, NullCallWrapper()); | 1315 CALL_FUNCTION, NullCallWrapper()); |
1307 } else { | 1316 } else { |
1308 // If we generate a global code snippet for deoptimization only, remember | 1317 // If we generate a global code snippet for deoptimization only, remember |
1309 // the place to continue after deoptimization. | 1318 // the place to continue after deoptimization. |
1310 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1319 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1311 } | 1320 } |
1312 | 1321 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 static Register registers[] = { r2, r1, r0, r3, r4, r5 }; | 1408 static Register registers[] = { r2, r1, r0, r3, r4, r5 }; |
1400 return registers; | 1409 return registers; |
1401 } | 1410 } |
1402 | 1411 |
1403 | 1412 |
1404 #undef __ | 1413 #undef __ |
1405 #define __ ACCESS_MASM(masm) | 1414 #define __ ACCESS_MASM(masm) |
1406 | 1415 |
1407 | 1416 |
1408 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1417 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 1418 Handle<HeapType> type, |
1409 Register receiver, | 1419 Register receiver, |
1410 Handle<JSFunction> getter) { | 1420 Handle<JSFunction> getter) { |
1411 // ----------- S t a t e ------------- | 1421 // ----------- S t a t e ------------- |
1412 // -- r0 : receiver | 1422 // -- r0 : receiver |
1413 // -- r2 : name | 1423 // -- r2 : name |
1414 // -- lr : return address | 1424 // -- lr : return address |
1415 // ----------------------------------- | 1425 // ----------------------------------- |
1416 { | 1426 { |
1417 FrameScope scope(masm, StackFrame::INTERNAL); | 1427 FrameScope scope(masm, StackFrame::INTERNAL); |
1418 | 1428 |
1419 if (!getter.is_null()) { | 1429 if (!getter.is_null()) { |
1420 // Call the JavaScript getter with the receiver on the stack. | 1430 // Call the JavaScript getter with the receiver on the stack. |
| 1431 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
| 1432 // Swap in the global receiver. |
| 1433 __ ldr(receiver, |
| 1434 FieldMemOperand( |
| 1435 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
| 1436 } |
1421 __ push(receiver); | 1437 __ push(receiver); |
1422 ParameterCount actual(0); | 1438 ParameterCount actual(0); |
1423 ParameterCount expected(getter); | 1439 ParameterCount expected(getter); |
1424 __ InvokeFunction(getter, expected, actual, | 1440 __ InvokeFunction(getter, expected, actual, |
1425 CALL_FUNCTION, NullCallWrapper()); | 1441 CALL_FUNCTION, NullCallWrapper()); |
1426 } else { | 1442 } else { |
1427 // If we generate a global code snippet for deoptimization only, remember | 1443 // If we generate a global code snippet for deoptimization only, remember |
1428 // the place to continue after deoptimization. | 1444 // the place to continue after deoptimization. |
1429 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 1445 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
1430 } | 1446 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 // ----------------------------------- | 1612 // ----------------------------------- |
1597 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1613 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1598 } | 1614 } |
1599 | 1615 |
1600 | 1616 |
1601 #undef __ | 1617 #undef __ |
1602 | 1618 |
1603 } } // namespace v8::internal | 1619 } } // namespace v8::internal |
1604 | 1620 |
1605 #endif // V8_TARGET_ARCH_ARM | 1621 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |