Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 | 510 |
| 511 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 511 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| 512 __ EnterInternalFrame(); | 512 __ EnterInternalFrame(); |
| 513 | 513 |
| 514 __ push(Operand(ebp, 4 * kPointerSize)); // push this | 514 __ push(Operand(ebp, 4 * kPointerSize)); // push this |
| 515 __ push(Operand(ebp, 2 * kPointerSize)); // push arguments | 515 __ push(Operand(ebp, 2 * kPointerSize)); // push arguments |
| 516 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); | 516 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); |
| 517 | 517 |
| 518 // Eagerly check for stack-overflow before pushing all the arguments | 518 // Eagerly check for stack-overflow before pushing all the arguments |
| 519 // to the stack. | 519 // to the stack. |
| 520 Label okay; | 520 if (true && FLAG_check_stack) { |
|
bak
2008/09/26 09:25:50
Please remove true &&. It does not add much.
Søren Thygesen Gjesse
2008/09/26 10:33:15
Sorry about that - testing leftover.
| |
| 521 __ lea(ecx, Operand(esp, -3 * kPointerSize)); // receiver, limit, index | 521 Label okay; |
| 522 __ mov(edx, Operand(eax)); | 522 __ lea(ecx, Operand(esp, -3 * kPointerSize)); // receiver, limit, index |
| 523 __ shl(edx, kPointerSizeLog2 - kSmiTagSize); | 523 __ mov(edx, Operand(eax)); |
| 524 __ sub(ecx, Operand(edx)); | 524 __ shl(edx, kPointerSizeLog2 - kSmiTagSize); |
| 525 ExternalReference stack_guard_limit_address = | 525 __ sub(ecx, Operand(edx)); |
| 526 ExternalReference::address_of_stack_guard_limit(); | 526 ExternalReference stack_guard_limit_address = |
| 527 __ cmp(ecx, Operand::StaticVariable(stack_guard_limit_address)); | 527 ExternalReference::address_of_stack_guard_limit(); |
| 528 __ j(greater, &okay, taken); | 528 __ cmp(ecx, Operand::StaticVariable(stack_guard_limit_address)); |
| 529 __ j(above_equal, &okay, taken); | |
| 529 | 530 |
| 530 // Too bad: Out of stack space. | 531 // Too bad: Out of stack space. |
| 531 __ push(Operand(ebp, 4 * kPointerSize)); // push this | 532 __ push(Operand(ebp, 4 * kPointerSize)); // push this |
| 532 __ push(eax); | 533 __ push(eax); |
| 533 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); | 534 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); |
| 534 __ bind(&okay); | 535 __ bind(&okay); |
| 536 } | |
| 535 | 537 |
| 536 // Push current index and limit. | 538 // Push current index and limit. |
| 537 const int kLimitOffset = | 539 const int kLimitOffset = |
| 538 StandardFrameConstants::kExpressionsOffset - 1 * kPointerSize; | 540 StandardFrameConstants::kExpressionsOffset - 1 * kPointerSize; |
| 539 const int kIndexOffset = kLimitOffset - 1 * kPointerSize; | 541 const int kIndexOffset = kLimitOffset - 1 * kPointerSize; |
| 540 __ push(eax); // limit | 542 __ push(eax); // limit |
| 541 __ push(Immediate(0)); // index | 543 __ push(Immediate(0)); // index |
| 542 | 544 |
| 543 // Change context eagerly to get the right global object if | 545 // Change context eagerly to get the right global object if |
| 544 // necessary. | 546 // necessary. |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 876 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). | 878 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). |
| 877 // ----------- S t a t e ------------- | 879 // ----------- S t a t e ------------- |
| 878 // No registers used on entry. | 880 // No registers used on entry. |
| 879 // ----------------------------------- | 881 // ----------------------------------- |
| 880 Generate_DebugBreakCallHelper(masm, 0, false); | 882 Generate_DebugBreakCallHelper(masm, 0, false); |
| 881 } | 883 } |
| 882 | 884 |
| 883 #undef __ | 885 #undef __ |
| 884 | 886 |
| 885 } } // namespace v8::internal | 887 } } // namespace v8::internal |
| OLD | NEW |