| 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 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3626 __ mov(eax, result_operand); | 3626 __ mov(eax, result_operand); |
| 3627 // Drop temp values from the stack, and restore context register. | 3627 // Drop temp values from the stack, and restore context register. |
| 3628 __ add(Operand(esp), Immediate(3 * kPointerSize)); | 3628 __ add(Operand(esp), Immediate(3 * kPointerSize)); |
| 3629 | 3629 |
| 3630 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 3630 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 3631 decrement_stack_height(); | 3631 decrement_stack_height(); |
| 3632 context()->Plug(eax); | 3632 context()->Plug(eax); |
| 3633 } | 3633 } |
| 3634 | 3634 |
| 3635 | 3635 |
| 3636 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) { | |
| 3637 ASSERT(args->length() == 1); | |
| 3638 | |
| 3639 // Load the function into eax. | |
| 3640 VisitForAccumulatorValue(args->at(0)); | |
| 3641 | |
| 3642 // Prepare for the test. | |
| 3643 Label materialize_true, materialize_false; | |
| 3644 Label* if_true = NULL; | |
| 3645 Label* if_false = NULL; | |
| 3646 Label* fall_through = NULL; | |
| 3647 context()->PrepareTest(&materialize_true, &materialize_false, | |
| 3648 &if_true, &if_false, &fall_through); | |
| 3649 | |
| 3650 // Test for strict mode function. | |
| 3651 __ mov(ecx, FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset)); | |
| 3652 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), | |
| 3653 1 << SharedFunctionInfo::kStrictModeBitWithinByte); | |
| 3654 __ j(not_equal, if_true); | |
| 3655 | |
| 3656 // Test for native function. | |
| 3657 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset), | |
| 3658 1 << SharedFunctionInfo::kNativeBitWithinByte); | |
| 3659 __ j(not_equal, if_true); | |
| 3660 | |
| 3661 // Not native or strict-mode function. | |
| 3662 __ jmp(if_false); | |
| 3663 | |
| 3664 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); | |
| 3665 context()->Plug(if_true, if_false); | |
| 3666 } | |
| 3667 | |
| 3668 | |
| 3669 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3636 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
| 3670 Handle<String> name = expr->name(); | 3637 Handle<String> name = expr->name(); |
| 3671 if (name->length() > 0 && name->Get(0) == '_') { | 3638 if (name->length() > 0 && name->Get(0) == '_') { |
| 3672 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3639 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
| 3673 EmitInlineRuntimeCall(expr); | 3640 EmitInlineRuntimeCall(expr); |
| 3674 return; | 3641 return; |
| 3675 } | 3642 } |
| 3676 | 3643 |
| 3677 Comment cmnt(masm_, "[ CallRuntime"); | 3644 Comment cmnt(masm_, "[ CallRuntime"); |
| 3678 ZoneList<Expression*>* args = expr->arguments(); | 3645 ZoneList<Expression*>* args = expr->arguments(); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4372 __ add(Operand(edx), Immediate(masm_->CodeObject())); | 4339 __ add(Operand(edx), Immediate(masm_->CodeObject())); |
| 4373 __ jmp(Operand(edx)); | 4340 __ jmp(Operand(edx)); |
| 4374 } | 4341 } |
| 4375 | 4342 |
| 4376 | 4343 |
| 4377 #undef __ | 4344 #undef __ |
| 4378 | 4345 |
| 4379 } } // namespace v8::internal | 4346 } } // namespace v8::internal |
| 4380 | 4347 |
| 4381 #endif // V8_TARGET_ARCH_IA32 | 4348 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |