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 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3525 __ bind(&done); | 3525 __ bind(&done); |
3526 __ mov(eax, result_operand); | 3526 __ mov(eax, result_operand); |
3527 // Drop temp values from the stack, and restore context register. | 3527 // Drop temp values from the stack, and restore context register. |
3528 __ add(Operand(esp), Immediate(3 * kPointerSize)); | 3528 __ add(Operand(esp), Immediate(3 * kPointerSize)); |
3529 | 3529 |
3530 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 3530 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
3531 context()->Plug(eax); | 3531 context()->Plug(eax); |
3532 } | 3532 } |
3533 | 3533 |
3534 | 3534 |
| 3535 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) { |
| 3536 ASSERT(args->length() == 1); |
| 3537 |
| 3538 // Load the function into eax. |
| 3539 VisitForAccumulatorValue(args->at(0)); |
| 3540 |
| 3541 // Prepare for the test. |
| 3542 Label materialize_true, materialize_false; |
| 3543 Label* if_true = NULL; |
| 3544 Label* if_false = NULL; |
| 3545 Label* fall_through = NULL; |
| 3546 context()->PrepareTest(&materialize_true, &materialize_false, |
| 3547 &if_true, &if_false, &fall_through); |
| 3548 |
| 3549 // Test for strict mode function. |
| 3550 __ mov(ecx, FieldOperand(eax, JSFunction::kSharedFunctionInfoOffset)); |
| 3551 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kStrictModeByteOffset), |
| 3552 1 << SharedFunctionInfo::kStrictModeBitWithinByte); |
| 3553 __ j(not_equal, if_true); |
| 3554 |
| 3555 // Test for native function. |
| 3556 __ test_b(FieldOperand(ecx, SharedFunctionInfo::kNativeByteOffset), |
| 3557 1 << SharedFunctionInfo::kNativeBitWithinByte); |
| 3558 __ j(not_equal, if_true); |
| 3559 |
| 3560 // Not native or strict-mode function. |
| 3561 __ jmp(if_false); |
| 3562 |
| 3563 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false); |
| 3564 context()->Plug(if_true, if_false); |
| 3565 } |
| 3566 |
| 3567 |
3535 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 3568 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
3536 Handle<String> name = expr->name(); | 3569 Handle<String> name = expr->name(); |
3537 if (name->length() > 0 && name->Get(0) == '_') { | 3570 if (name->length() > 0 && name->Get(0) == '_') { |
3538 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 3571 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
3539 EmitInlineRuntimeCall(expr); | 3572 EmitInlineRuntimeCall(expr); |
3540 return; | 3573 return; |
3541 } | 3574 } |
3542 | 3575 |
3543 Comment cmnt(masm_, "[ CallRuntime"); | 3576 Comment cmnt(masm_, "[ CallRuntime"); |
3544 ZoneList<Expression*>* args = expr->arguments(); | 3577 ZoneList<Expression*>* args = expr->arguments(); |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4223 // And return. | 4256 // And return. |
4224 __ ret(0); | 4257 __ ret(0); |
4225 } | 4258 } |
4226 | 4259 |
4227 | 4260 |
4228 #undef __ | 4261 #undef __ |
4229 | 4262 |
4230 } } // namespace v8::internal | 4263 } } // namespace v8::internal |
4231 | 4264 |
4232 #endif // V8_TARGET_ARCH_IA32 | 4265 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |