| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 // rsp[(argc + 1) * 8] : argument 0 = receiver | 1165 // rsp[(argc + 1) * 8] : argument 0 = receiver |
| 1166 // ----------------------------------- | 1166 // ----------------------------------- |
| 1167 Label number, non_number, non_string, boolean, probe, miss; | 1167 Label number, non_number, non_string, boolean, probe, miss; |
| 1168 | 1168 |
| 1169 // Get the receiver of the function from the stack; 1 ~ return address. | 1169 // Get the receiver of the function from the stack; 1 ~ return address. |
| 1170 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 1170 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
| 1171 | 1171 |
| 1172 // Probe the stub cache. | 1172 // Probe the stub cache. |
| 1173 Code::Flags flags = | 1173 Code::Flags flags = |
| 1174 Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc); | 1174 Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc); |
| 1175 StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, rax); | 1175 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, |
| 1176 rax); |
| 1176 | 1177 |
| 1177 // If the stub cache probing failed, the receiver might be a value. | 1178 // If the stub cache probing failed, the receiver might be a value. |
| 1178 // For value objects, we use the map of the prototype objects for | 1179 // For value objects, we use the map of the prototype objects for |
| 1179 // the corresponding JSValue for the cache and that is what we need | 1180 // the corresponding JSValue for the cache and that is what we need |
| 1180 // to probe. | 1181 // to probe. |
| 1181 // | 1182 // |
| 1182 // Check for number. | 1183 // Check for number. |
| 1183 __ JumpIfSmi(rdx, &number); | 1184 __ JumpIfSmi(rdx, &number); |
| 1184 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rbx); | 1185 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rbx); |
| 1185 __ j(not_equal, &non_number); | 1186 __ j(not_equal, &non_number); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1201 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); | 1202 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); |
| 1202 __ j(equal, &boolean); | 1203 __ j(equal, &boolean); |
| 1203 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); | 1204 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); |
| 1204 __ j(not_equal, &miss); | 1205 __ j(not_equal, &miss); |
| 1205 __ bind(&boolean); | 1206 __ bind(&boolean); |
| 1206 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 1207 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
| 1207 masm, Context::BOOLEAN_FUNCTION_INDEX, rdx); | 1208 masm, Context::BOOLEAN_FUNCTION_INDEX, rdx); |
| 1208 | 1209 |
| 1209 // Probe the stub cache for the value object. | 1210 // Probe the stub cache for the value object. |
| 1210 __ bind(&probe); | 1211 __ bind(&probe); |
| 1211 StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg); | 1212 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, |
| 1213 no_reg); |
| 1212 | 1214 |
| 1213 // Cache miss: Jump to runtime. | 1215 // Cache miss: Jump to runtime. |
| 1214 __ bind(&miss); | 1216 __ bind(&miss); |
| 1215 GenerateMiss(masm, argc); | 1217 GenerateMiss(masm, argc); |
| 1216 } | 1218 } |
| 1217 | 1219 |
| 1218 | 1220 |
| 1219 static void GenerateNormalHelper(MacroAssembler* masm, | 1221 static void GenerateNormalHelper(MacroAssembler* masm, |
| 1220 int argc, | 1222 int argc, |
| 1221 bool is_global_object, | 1223 bool is_global_object, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 // ----------- S t a t e ------------- | 1386 // ----------- S t a t e ------------- |
| 1385 // -- rax : receiver | 1387 // -- rax : receiver |
| 1386 // -- rcx : name | 1388 // -- rcx : name |
| 1387 // -- rsp[0] : return address | 1389 // -- rsp[0] : return address |
| 1388 // ----------------------------------- | 1390 // ----------------------------------- |
| 1389 | 1391 |
| 1390 // Probe the stub cache. | 1392 // Probe the stub cache. |
| 1391 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, | 1393 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, |
| 1392 NOT_IN_LOOP, | 1394 NOT_IN_LOOP, |
| 1393 MONOMORPHIC); | 1395 MONOMORPHIC); |
| 1394 StubCache::GenerateProbe(masm, flags, rax, rcx, rbx, rdx); | 1396 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rax, rcx, rbx, |
| 1397 rdx); |
| 1395 | 1398 |
| 1396 // Cache miss: Jump to runtime. | 1399 // Cache miss: Jump to runtime. |
| 1397 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); | 1400 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); |
| 1398 } | 1401 } |
| 1399 | 1402 |
| 1400 | 1403 |
| 1401 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 1404 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
| 1402 // ----------- S t a t e ------------- | 1405 // ----------- S t a t e ------------- |
| 1403 // -- rax : receiver | 1406 // -- rax : receiver |
| 1404 // -- rcx : name | 1407 // -- rcx : name |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 // -- rax : value | 1512 // -- rax : value |
| 1510 // -- rcx : name | 1513 // -- rcx : name |
| 1511 // -- rdx : receiver | 1514 // -- rdx : receiver |
| 1512 // -- rsp[0] : return address | 1515 // -- rsp[0] : return address |
| 1513 // ----------------------------------- | 1516 // ----------------------------------- |
| 1514 | 1517 |
| 1515 // Get the receiver from the stack and probe the stub cache. | 1518 // Get the receiver from the stack and probe the stub cache. |
| 1516 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, | 1519 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, |
| 1517 NOT_IN_LOOP, | 1520 NOT_IN_LOOP, |
| 1518 MONOMORPHIC); | 1521 MONOMORPHIC); |
| 1519 StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg); | 1522 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, |
| 1523 no_reg); |
| 1520 | 1524 |
| 1521 // Cache miss: Jump to runtime. | 1525 // Cache miss: Jump to runtime. |
| 1522 GenerateMiss(masm); | 1526 GenerateMiss(masm); |
| 1523 } | 1527 } |
| 1524 | 1528 |
| 1525 | 1529 |
| 1526 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { | 1530 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { |
| 1527 // ----------- S t a t e ------------- | 1531 // ----------- S t a t e ------------- |
| 1528 // -- rax : value | 1532 // -- rax : value |
| 1529 // -- rcx : name | 1533 // -- rcx : name |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 GenerateMiss(masm); | 1576 GenerateMiss(masm); |
| 1573 } | 1577 } |
| 1574 | 1578 |
| 1575 | 1579 |
| 1576 #undef __ | 1580 #undef __ |
| 1577 | 1581 |
| 1578 | 1582 |
| 1579 } } // namespace v8::internal | 1583 } } // namespace v8::internal |
| 1580 | 1584 |
| 1581 #endif // V8_TARGET_ARCH_X64 | 1585 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |