OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 } | 1232 } |
1233 | 1233 |
1234 | 1234 |
1235 #undef __ | 1235 #undef __ |
1236 #define __ ACCESS_MASM(masm) | 1236 #define __ ACCESS_MASM(masm) |
1237 | 1237 |
1238 | 1238 |
1239 void StoreStubCompiler::GenerateStoreViaSetter( | 1239 void StoreStubCompiler::GenerateStoreViaSetter( |
1240 MacroAssembler* masm, | 1240 MacroAssembler* masm, |
1241 Handle<HeapType> type, | 1241 Handle<HeapType> type, |
| 1242 Register receiver, |
1242 Handle<JSFunction> setter) { | 1243 Handle<JSFunction> setter) { |
1243 // ----------- S t a t e ------------- | 1244 // ----------- S t a t e ------------- |
1244 // -- x0 : value | |
1245 // -- x1 : receiver | |
1246 // -- x2 : name | |
1247 // -- lr : return address | 1245 // -- lr : return address |
1248 // ----------------------------------- | 1246 // ----------------------------------- |
1249 Register value = x0; | |
1250 Register receiver = x1; | |
1251 Label miss; | 1247 Label miss; |
1252 | 1248 |
1253 { | 1249 { |
1254 FrameScope scope(masm, StackFrame::INTERNAL); | 1250 FrameScope scope(masm, StackFrame::INTERNAL); |
1255 | 1251 |
1256 // Save value register, so we can restore it later. | 1252 // Save value register, so we can restore it later. |
1257 __ Push(value); | 1253 __ Push(value()); |
1258 | 1254 |
1259 if (!setter.is_null()) { | 1255 if (!setter.is_null()) { |
1260 // Call the JavaScript setter with receiver and value on the stack. | 1256 // Call the JavaScript setter with receiver and value on the stack. |
1261 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { | 1257 if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
1262 // Swap in the global receiver. | 1258 // Swap in the global receiver. |
1263 __ Ldr(receiver, | 1259 __ Ldr(receiver, |
1264 FieldMemOperand( | 1260 FieldMemOperand( |
1265 receiver, JSGlobalObject::kGlobalReceiverOffset)); | 1261 receiver, JSGlobalObject::kGlobalReceiverOffset)); |
1266 } | 1262 } |
1267 __ Push(receiver, value); | 1263 __ Push(receiver, value()); |
1268 ParameterCount actual(1); | 1264 ParameterCount actual(1); |
1269 ParameterCount expected(setter); | 1265 ParameterCount expected(setter); |
1270 __ InvokeFunction(setter, expected, actual, | 1266 __ InvokeFunction(setter, expected, actual, |
1271 CALL_FUNCTION, NullCallWrapper()); | 1267 CALL_FUNCTION, NullCallWrapper()); |
1272 } else { | 1268 } else { |
1273 // If we generate a global code snippet for deoptimization only, remember | 1269 // If we generate a global code snippet for deoptimization only, remember |
1274 // the place to continue after deoptimization. | 1270 // the place to continue after deoptimization. |
1275 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); | 1271 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
1276 } | 1272 } |
1277 | 1273 |
1278 // We have to return the passed value, not the return value of the setter. | 1274 // We have to return the passed value, not the return value of the setter. |
1279 __ Pop(value); | 1275 __ Pop(x0); |
1280 | 1276 |
1281 // Restore context register. | 1277 // Restore context register. |
1282 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1278 __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
1283 } | 1279 } |
1284 __ Ret(); | 1280 __ Ret(); |
1285 } | 1281 } |
1286 | 1282 |
1287 | 1283 |
1288 #undef __ | 1284 #undef __ |
1289 #define __ ACCESS_MASM(masm()) | 1285 #define __ ACCESS_MASM(masm()) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 } | 1332 } |
1337 | 1333 |
1338 | 1334 |
1339 Register* KeyedLoadStubCompiler::registers() { | 1335 Register* KeyedLoadStubCompiler::registers() { |
1340 // receiver, name/key, scratch1, scratch2, scratch3, scratch4. | 1336 // receiver, name/key, scratch1, scratch2, scratch3, scratch4. |
1341 static Register registers[] = { x1, x0, x2, x3, x4, x5 }; | 1337 static Register registers[] = { x1, x0, x2, x3, x4, x5 }; |
1342 return registers; | 1338 return registers; |
1343 } | 1339 } |
1344 | 1340 |
1345 | 1341 |
| 1342 Register StoreStubCompiler::value() { |
| 1343 return x0; |
| 1344 } |
| 1345 |
| 1346 |
1346 Register* StoreStubCompiler::registers() { | 1347 Register* StoreStubCompiler::registers() { |
1347 // receiver, name, value, scratch1, scratch2, scratch3. | 1348 // receiver, value, scratch1, scratch2, scratch3. |
1348 static Register registers[] = { x1, x2, x0, x3, x4, x5 }; | 1349 static Register registers[] = { x1, x2, x3, x4, x5 }; |
1349 return registers; | 1350 return registers; |
1350 } | 1351 } |
1351 | 1352 |
1352 | 1353 |
1353 Register* KeyedStoreStubCompiler::registers() { | 1354 Register* KeyedStoreStubCompiler::registers() { |
1354 // receiver, name, value, scratch1, scratch2, scratch3. | 1355 // receiver, name, scratch1, scratch2, scratch3. |
1355 static Register registers[] = { x2, x1, x0, x3, x4, x5 }; | 1356 static Register registers[] = { x2, x1, x3, x4, x5 }; |
1356 return registers; | 1357 return registers; |
1357 } | 1358 } |
1358 | 1359 |
1359 | 1360 |
1360 #undef __ | 1361 #undef __ |
1361 #define __ ACCESS_MASM(masm) | 1362 #define __ ACCESS_MASM(masm) |
1362 | 1363 |
1363 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 1364 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
1364 Handle<HeapType> type, | 1365 Handle<HeapType> type, |
1365 Register receiver, | 1366 Register receiver, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 | 1539 |
1539 // Miss case, call the runtime. | 1540 // Miss case, call the runtime. |
1540 __ Bind(&miss); | 1541 __ Bind(&miss); |
1541 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1542 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1542 } | 1543 } |
1543 | 1544 |
1544 | 1545 |
1545 } } // namespace v8::internal | 1546 } } // namespace v8::internal |
1546 | 1547 |
1547 #endif // V8_TARGET_ARCH_A64 | 1548 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |