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 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3511 __ movq(rax, result_operand); | 3511 __ movq(rax, result_operand); |
3512 | 3512 |
3513 __ bind(&return_result); | 3513 __ bind(&return_result); |
3514 // Drop temp values from the stack, and restore context register. | 3514 // Drop temp values from the stack, and restore context register. |
3515 __ addq(rsp, Immediate(3 * kPointerSize)); | 3515 __ addq(rsp, Immediate(3 * kPointerSize)); |
3516 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 3516 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
3517 context()->Plug(rax); | 3517 context()->Plug(rax); |
3518 } | 3518 } |
3519 | 3519 |
3520 | 3520 |
3521 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) { | |
3522 ASSERT(args->length() == 1); | |
3523 | |
3524 // Load the function into rax. | |
3525 VisitForAccumulatorValue(args->at(0)); | |
3526 | |
3527 // Prepare for the test. | |
3528 Label materialize_true, materialize_false; | |
3529 Label* if_true = NULL; | |
3530 Label* if_false = NULL; | |
3531 Label* fall_through = NULL; | |
3532 context()->PrepareTest(&materialize_true, &materialize_false, | |
3533 &if_true, &if_false, &fall_through); | |
3534 | |
3535 // Test for strict mode function. | |
3536 __ movq(rdx, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); | |
3537 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset), | |
3538 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte)); | |
3539 __ j(not_equal, if_true); | |
3540 | |
3541 // Test for native function. | |
3542 __ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset), | |
3543 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); | |
3544 __ j(not_equal, if_true); | |
3545 | |
3546 // Not native or strict-mode function. | |
3547 __ jmp(if_false); | |
3548 | |
3549 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); | |
3550 context()->Plug(if_true, if_false); | |
3551 } | |
3552 | |
3553 | |
3554 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3521 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
3555 Handle<String> name = expr->name(); | 3522 Handle<String> name = expr->name(); |
3556 if (name->length() > 0 && name->Get(0) == '_') { | 3523 if (name->length() > 0 && name->Get(0) == '_') { |
3557 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3524 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
3558 EmitInlineRuntimeCall(expr); | 3525 EmitInlineRuntimeCall(expr); |
3559 return; | 3526 return; |
3560 } | 3527 } |
3561 | 3528 |
3562 Comment cmnt(masm_, "[ CallRuntime"); | 3529 Comment cmnt(masm_, "[ CallRuntime"); |
3563 ZoneList<Expression*>* args = expr->arguments(); | 3530 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4237 __ jmp(rdx); | 4204 __ jmp(rdx); |
4238 } | 4205 } |
4239 | 4206 |
4240 | 4207 |
4241 #undef __ | 4208 #undef __ |
4242 | 4209 |
4243 | 4210 |
4244 } } // namespace v8::internal | 4211 } } // namespace v8::internal |
4245 | 4212 |
4246 #endif // V8_TARGET_ARCH_X64 | 4213 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |