OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 411 |
412 // Push the receiver. | 412 // Push the receiver. |
413 __ bind(&push_receiver); | 413 __ bind(&push_receiver); |
414 __ push(rbx); | 414 __ push(rbx); |
415 | 415 |
416 // Copy all arguments from the array to the stack. | 416 // Copy all arguments from the array to the stack. |
417 Label entry, loop; | 417 Label entry, loop; |
418 __ movq(rax, Operand(rbp, kIndexOffset)); | 418 __ movq(rax, Operand(rbp, kIndexOffset)); |
419 __ jmp(&entry); | 419 __ jmp(&entry); |
420 __ bind(&loop); | 420 __ bind(&loop); |
421 __ movq(rcx, Operand(rbp, kArgumentsOffset)); // load arguments | 421 __ movq(rdx, Operand(rbp, kArgumentsOffset)); // load arguments |
422 __ push(rcx); | |
423 __ push(rax); | |
424 | 422 |
425 // Use inline caching to speed up access to arguments. | 423 // Use inline caching to speed up access to arguments. |
426 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 424 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
427 __ Call(ic, RelocInfo::CODE_TARGET); | 425 __ Call(ic, RelocInfo::CODE_TARGET); |
428 // It is important that we do not have a test instruction after the | 426 // It is important that we do not have a test instruction after the |
429 // call. A test instruction after the call is used to indicate that | 427 // call. A test instruction after the call is used to indicate that |
430 // we have generated an inline version of the keyed load. In this | 428 // we have generated an inline version of the keyed load. In this |
431 // case, we know that we are not generating a test instruction next. | 429 // case, we know that we are not generating a test instruction next. |
432 | 430 |
433 // Remove IC arguments from the stack and push the nth argument. | 431 // Push the nth argument. |
434 __ addq(rsp, Immediate(2 * kPointerSize)); | |
435 __ push(rax); | 432 __ push(rax); |
436 | 433 |
437 // Update the index on the stack and in register rax. | 434 // Update the index on the stack and in register rax. |
438 __ movq(rax, Operand(rbp, kIndexOffset)); | 435 __ movq(rax, Operand(rbp, kIndexOffset)); |
439 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); | 436 __ SmiAddConstant(rax, rax, Smi::FromInt(1)); |
440 __ movq(Operand(rbp, kIndexOffset), rax); | 437 __ movq(Operand(rbp, kIndexOffset), rax); |
441 | 438 |
442 __ bind(&entry); | 439 __ bind(&entry); |
443 __ cmpq(rax, Operand(rbp, kLimitOffset)); | 440 __ cmpq(rax, Operand(rbp, kLimitOffset)); |
444 __ j(not_equal, &loop); | 441 __ j(not_equal, &loop); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 } | 1291 } |
1295 | 1292 |
1296 | 1293 |
1297 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { | 1294 void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
1298 Generate_JSEntryTrampolineHelper(masm, true); | 1295 Generate_JSEntryTrampolineHelper(masm, true); |
1299 } | 1296 } |
1300 | 1297 |
1301 } } // namespace v8::internal | 1298 } } // namespace v8::internal |
1302 | 1299 |
1303 #endif // V8_TARGET_ARCH_X64 | 1300 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |