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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 } | 1252 } |
1253 | 1253 |
1254 | 1254 |
1255 #undef __ | 1255 #undef __ |
1256 #define __ ACCESS_MASM(masm) | 1256 #define __ ACCESS_MASM(masm) |
1257 | 1257 |
1258 | 1258 |
1259 void StoreStubCompiler::GenerateStoreViaSetter( | 1259 void StoreStubCompiler::GenerateStoreViaSetter( |
1260 MacroAssembler* masm, | 1260 MacroAssembler* masm, |
1261 Handle<HeapType> type, | 1261 Handle<HeapType> type, |
| 1262 Register receiver, |
1262 Handle<JSFunction> setter) { | 1263 Handle<JSFunction> setter) { |
1263 // ----------- S t a t e ------------- | 1264 // ----------- S t a t e ------------- |
1264 // -- eax : value | |
1265 // -- ecx : name | |
1266 // -- edx : receiver | |
1267 // -- esp[0] : return address | 1265 // -- esp[0] : return address |
1268 // ----------------------------------- | 1266 // ----------------------------------- |
1269 { | 1267 { |
1270 FrameScope scope(masm, StackFrame::INTERNAL); | 1268 FrameScope scope(masm, StackFrame::INTERNAL); |
1271 Register receiver = edx; | |
1272 Register value = eax; | |
1273 | 1269 |
1274 // Save value register, so we can restore it later. | 1270 // Save value register, so we can restore it later. |
1275 __ push(value); | 1271 __ push(value()); |
1276 | 1272 |
1277 if (!setter.is_null()) { | 1273 if (!setter.is_null()) { |
1278 // Call the JavaScript setter with receiver and value on the stack. | 1274 // Call the JavaScript setter with receiver and value on the stack. |
1279 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 1275 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
1280 // Swap in the global receiver. | 1276 // Swap in the global receiver. |
1281 __ mov(receiver, | 1277 __ mov(receiver, |
1282 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); | 1278 FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); |
1283 } | 1279 } |
1284 __ push(receiver); | 1280 __ push(receiver); |
1285 __ push(value); | 1281 __ push(value()); |
1286 ParameterCount actual(1); | 1282 ParameterCount actual(1); |
1287 ParameterCount expected(setter); | 1283 ParameterCount expected(setter); |
1288 __ InvokeFunction(setter, expected, actual, | 1284 __ InvokeFunction(setter, expected, actual, |
1289 CALL_FUNCTION, NullCallWrapper()); | 1285 CALL_FUNCTION, NullCallWrapper()); |
1290 } else { | 1286 } else { |
1291 // If we generate a global code snippet for deoptimization only, remember | 1287 // If we generate a global code snippet for deoptimization only, remember |
1292 // the place to continue after deoptimization. | 1288 // the place to continue after deoptimization. |
1293 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1289 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1294 } | 1290 } |
1295 | 1291 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 } | 1372 } |
1377 | 1373 |
1378 | 1374 |
1379 Register* KeyedLoadStubCompiler::registers() { | 1375 Register* KeyedLoadStubCompiler::registers() { |
1380 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1376 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1381 static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; | 1377 static Register registers[] = { edx, ecx, ebx, eax, edi, no_reg }; |
1382 return registers; | 1378 return registers; |
1383 } | 1379 } |
1384 | 1380 |
1385 | 1381 |
| 1382 Register StoreStubCompiler::value() { |
| 1383 return eax; |
| 1384 } |
| 1385 |
| 1386 |
1386 Register* StoreStubCompiler::registers() { | 1387 Register* StoreStubCompiler::registers() { |
1387 // receiver, name, value, scratch1, scratch2, scratch3. | 1388 // receiver, name, scratch1, scratch2, scratch3. |
1388 static Register registers[] = { edx, ecx, eax, ebx, edi, no_reg }; | 1389 static Register registers[] = { edx, ecx, ebx, edi, no_reg }; |
1389 return registers; | 1390 return registers; |
1390 } | 1391 } |
1391 | 1392 |
1392 | 1393 |
1393 Register* KeyedStoreStubCompiler::registers() { | 1394 Register* KeyedStoreStubCompiler::registers() { |
1394 // receiver, name, value, scratch1, scratch2, scratch3. | 1395 // receiver, name, scratch1, scratch2, scratch3. |
1395 static Register registers[] = { edx, ecx, eax, ebx, edi, no_reg }; | 1396 static Register registers[] = { edx, ecx, ebx, edi, no_reg }; |
1396 return registers; | 1397 return registers; |
1397 } | 1398 } |
1398 | 1399 |
1399 | 1400 |
1400 #undef __ | 1401 #undef __ |
1401 #define __ ACCESS_MASM(masm) | 1402 #define __ ACCESS_MASM(masm) |
1402 | 1403 |
1403 | 1404 |
1404 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1405 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
1405 Handle<HeapType> type, | 1406 Handle<HeapType> type, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 // ----------------------------------- | 1569 // ----------------------------------- |
1569 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1570 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1570 } | 1571 } |
1571 | 1572 |
1572 | 1573 |
1573 #undef __ | 1574 #undef __ |
1574 | 1575 |
1575 } } // namespace v8::internal | 1576 } } // namespace v8::internal |
1576 | 1577 |
1577 #endif // V8_TARGET_ARCH_IA32 | 1578 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |