OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 // esp[0]: return address | 1320 // esp[0]: return address |
1321 // esp[8]: last argument | 1321 // esp[8]: last argument |
1322 __ pop(rcx); | 1322 __ pop(rcx); |
1323 __ lea(rsp, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize)); | 1323 __ lea(rsp, Operand(rsp, rax, times_pointer_size, 1 * kPointerSize)); |
1324 __ push(rcx); | 1324 __ push(rcx); |
1325 __ movq(rax, rbx); | 1325 __ movq(rax, rbx); |
1326 __ ret(0); | 1326 __ ret(0); |
1327 } | 1327 } |
1328 | 1328 |
1329 | 1329 |
| 1330 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { |
| 1331 // ----------- S t a t e ------------- |
| 1332 // -- rax : argc |
| 1333 // -- rsp[0] : return address |
| 1334 // -- rsp[8] : last argument |
| 1335 // ----------------------------------- |
| 1336 Label generic_array_code; |
| 1337 |
| 1338 // Get the InternalArray function. |
| 1339 __ LoadGlobalFunction(Context::INTERNAL_ARRAY_FUNCTION_INDEX, rdi); |
| 1340 |
| 1341 if (FLAG_debug_code) { |
| 1342 // Initial map for the builtin InternalArray functions should be maps. |
| 1343 __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); |
| 1344 // Will both indicate a NULL and a Smi. |
| 1345 STATIC_ASSERT(kSmiTag == 0); |
| 1346 Condition not_smi = NegateCondition(masm->CheckSmi(rbx)); |
| 1347 __ Check(not_smi, "Unexpected initial map for InternalArray function"); |
| 1348 __ CmpObjectType(rbx, MAP_TYPE, rcx); |
| 1349 __ Check(equal, "Unexpected initial map for InternalArray function"); |
| 1350 } |
| 1351 |
| 1352 // Run the native code for the InternalArray function called as a normal |
| 1353 // function. |
| 1354 ArrayNativeCode(masm, &generic_array_code); |
| 1355 |
| 1356 // Jump to the generic array code in case the specialized code cannot handle |
| 1357 // the construction. |
| 1358 __ bind(&generic_array_code); |
| 1359 Handle<Code> array_code = |
| 1360 masm->isolate()->builtins()->ArrayCodeGeneric(); |
| 1361 __ Jump(array_code, RelocInfo::CODE_TARGET); |
| 1362 } |
| 1363 |
| 1364 |
1330 void Builtins::Generate_ArrayCode(MacroAssembler* masm) { | 1365 void Builtins::Generate_ArrayCode(MacroAssembler* masm) { |
1331 // ----------- S t a t e ------------- | 1366 // ----------- S t a t e ------------- |
1332 // -- rax : argc | 1367 // -- rax : argc |
1333 // -- rsp[0] : return address | 1368 // -- rsp[0] : return address |
1334 // -- rsp[8] : last argument | 1369 // -- rsp[8] : last argument |
1335 // ----------------------------------- | 1370 // ----------------------------------- |
1336 Label generic_array_code; | 1371 Label generic_array_code; |
1337 | 1372 |
1338 // Get the Array function. | 1373 // Get the Array function. |
1339 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rdi); | 1374 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, rdi); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1611 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1577 generator.Generate(); | 1612 generator.Generate(); |
1578 } | 1613 } |
1579 | 1614 |
1580 | 1615 |
1581 #undef __ | 1616 #undef __ |
1582 | 1617 |
1583 } } // namespace v8::internal | 1618 } } // namespace v8::internal |
1584 | 1619 |
1585 #endif // V8_TARGET_ARCH_X64 | 1620 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |