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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 return GetCode(kind(), Code::FAST, name); | 1263 return GetCode(kind(), Code::FAST, name); |
1264 } | 1264 } |
1265 | 1265 |
1266 | 1266 |
1267 #undef __ | 1267 #undef __ |
1268 #define __ ACCESS_MASM(masm) | 1268 #define __ ACCESS_MASM(masm) |
1269 | 1269 |
1270 | 1270 |
1271 void StoreStubCompiler::GenerateStoreViaSetter( | 1271 void StoreStubCompiler::GenerateStoreViaSetter( |
1272 MacroAssembler* masm, | 1272 MacroAssembler* masm, |
| 1273 Handle<HeapType> type, |
1273 Handle<JSFunction> setter) { | 1274 Handle<JSFunction> setter) { |
1274 // ----------- S t a t e ------------- | 1275 // ----------- S t a t e ------------- |
1275 // -- a0 : value | 1276 // -- a0 : value |
1276 // -- a1 : receiver | 1277 // -- a1 : receiver |
1277 // -- a2 : name | 1278 // -- a2 : name |
1278 // -- ra : return address | 1279 // -- ra : return address |
1279 // ----------------------------------- | 1280 // ----------------------------------- |
1280 { | 1281 { |
1281 FrameScope scope(masm, StackFrame::INTERNAL); | 1282 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1283 Register receiver = a1; |
| 1284 Register value = a0; |
1282 | 1285 |
1283 // Save value register, so we can restore it later. | 1286 // Save value register, so we can restore it later. |
1284 __ push(a0); | 1287 __ push(value); |
1285 | 1288 |
1286 if (!setter.is_null()) { | 1289 if (!setter.is_null()) { |
1287 // Call the JavaScript setter with receiver and value on the stack. | 1290 // Call the JavaScript setter with receiver and value on the stack. |
1288 __ Push(a1, a0); | 1291 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
| 1292 // Swap in the global receiver. |
| 1293 __ lw(receiver, |
| 1294 FieldMemOperand( |
| 1295 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
| 1296 } |
| 1297 __ Push(receiver, value); |
1289 ParameterCount actual(1); | 1298 ParameterCount actual(1); |
1290 ParameterCount expected(setter); | 1299 ParameterCount expected(setter); |
1291 __ InvokeFunction(setter, expected, actual, | 1300 __ InvokeFunction(setter, expected, actual, |
1292 CALL_FUNCTION, NullCallWrapper()); | 1301 CALL_FUNCTION, NullCallWrapper()); |
1293 } else { | 1302 } else { |
1294 // If we generate a global code snippet for deoptimization only, remember | 1303 // If we generate a global code snippet for deoptimization only, remember |
1295 // the place to continue after deoptimization. | 1304 // the place to continue after deoptimization. |
1296 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1305 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1297 } | 1306 } |
1298 | 1307 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 static Register registers[] = { a2, a1, a0, a3, t0, t1 }; | 1393 static Register registers[] = { a2, a1, a0, a3, t0, t1 }; |
1385 return registers; | 1394 return registers; |
1386 } | 1395 } |
1387 | 1396 |
1388 | 1397 |
1389 #undef __ | 1398 #undef __ |
1390 #define __ ACCESS_MASM(masm) | 1399 #define __ ACCESS_MASM(masm) |
1391 | 1400 |
1392 | 1401 |
1393 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1402 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 1403 Handle<HeapType> type, |
1394 Register receiver, | 1404 Register receiver, |
1395 Handle<JSFunction> getter) { | 1405 Handle<JSFunction> getter) { |
1396 // ----------- S t a t e ------------- | 1406 // ----------- S t a t e ------------- |
1397 // -- a0 : receiver | 1407 // -- a0 : receiver |
1398 // -- a2 : name | 1408 // -- a2 : name |
1399 // -- ra : return address | 1409 // -- ra : return address |
1400 // ----------------------------------- | 1410 // ----------------------------------- |
1401 { | 1411 { |
1402 FrameScope scope(masm, StackFrame::INTERNAL); | 1412 FrameScope scope(masm, StackFrame::INTERNAL); |
1403 | 1413 |
1404 if (!getter.is_null()) { | 1414 if (!getter.is_null()) { |
1405 // Call the JavaScript getter with the receiver on the stack. | 1415 // Call the JavaScript getter with the receiver on the stack. |
| 1416 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
| 1417 // Swap in the global receiver. |
| 1418 __ lw(receiver, |
| 1419 FieldMemOperand( |
| 1420 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
| 1421 } |
1406 __ push(receiver); | 1422 __ push(receiver); |
1407 ParameterCount actual(0); | 1423 ParameterCount actual(0); |
1408 ParameterCount expected(getter); | 1424 ParameterCount expected(getter); |
1409 __ InvokeFunction(getter, expected, actual, | 1425 __ InvokeFunction(getter, expected, actual, |
1410 CALL_FUNCTION, NullCallWrapper()); | 1426 CALL_FUNCTION, NullCallWrapper()); |
1411 } else { | 1427 } else { |
1412 // If we generate a global code snippet for deoptimization only, remember | 1428 // If we generate a global code snippet for deoptimization only, remember |
1413 // the place to continue after deoptimization. | 1429 // the place to continue after deoptimization. |
1414 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); | 1430 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
1415 } | 1431 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 // ----------------------------------- | 1596 // ----------------------------------- |
1581 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1597 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1582 } | 1598 } |
1583 | 1599 |
1584 | 1600 |
1585 #undef __ | 1601 #undef __ |
1586 | 1602 |
1587 } } // namespace v8::internal | 1603 } } // namespace v8::internal |
1588 | 1604 |
1589 #endif // V8_TARGET_ARCH_MIPS | 1605 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |