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 3604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3615 Result obj = frame_->Pop(); | 3615 Result obj = frame_->Pop(); |
3616 obj.ToRegister(); | 3616 obj.ToRegister(); |
3617 Condition is_smi = masm_->CheckSmi(obj.reg()); | 3617 Condition is_smi = masm_->CheckSmi(obj.reg()); |
3618 destination()->false_target()->Branch(is_smi); | 3618 destination()->false_target()->Branch(is_smi); |
3619 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, kScratchRegister); | 3619 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, kScratchRegister); |
3620 obj.Unuse(); | 3620 obj.Unuse(); |
3621 destination()->Split(equal); | 3621 destination()->Split(equal); |
3622 } | 3622 } |
3623 | 3623 |
3624 | 3624 |
| 3625 void CodeGenerator::GenerateIsUndetectableObject(ZoneList<Expression*>* args) { |
| 3626 ASSERT(args->length() == 1); |
| 3627 Load(args->at(0)); |
| 3628 Result obj = frame_->Pop(); |
| 3629 obj.ToRegister(); |
| 3630 Condition is_smi = masm_->CheckSmi(obj.reg()); |
| 3631 destination()->false_target()->Branch(is_smi); |
| 3632 __ movq(kScratchRegister, FieldOperand(obj.reg(), HeapObject::kMapOffset)); |
| 3633 __ movzxbl(kScratchRegister, |
| 3634 FieldOperand(kScratchRegister, Map::kBitFieldOffset)); |
| 3635 __ testl(kScratchRegister, Immediate(1 << Map::kIsUndetectable)); |
| 3636 obj.Unuse(); |
| 3637 destination()->Split(not_zero); |
| 3638 } |
| 3639 |
| 3640 |
3625 void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { | 3641 void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { |
3626 ASSERT(args->length() == 0); | 3642 ASSERT(args->length() == 0); |
3627 | 3643 |
3628 // Get the frame pointer for the calling frame. | 3644 // Get the frame pointer for the calling frame. |
3629 Result fp = allocator()->Allocate(); | 3645 Result fp = allocator()->Allocate(); |
3630 __ movq(fp.reg(), Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 3646 __ movq(fp.reg(), Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
3631 | 3647 |
3632 // Skip the arguments adaptor frame if it exists. | 3648 // Skip the arguments adaptor frame if it exists. |
3633 Label check_frame_marker; | 3649 Label check_frame_marker; |
3634 __ SmiCompare(Operand(fp.reg(), StandardFrameConstants::kContextOffset), | 3650 __ SmiCompare(Operand(fp.reg(), StandardFrameConstants::kContextOffset), |
(...skipping 4750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8385 // Call the function from C++. | 8401 // Call the function from C++. |
8386 return FUNCTION_CAST<ModuloFunction>(buffer); | 8402 return FUNCTION_CAST<ModuloFunction>(buffer); |
8387 } | 8403 } |
8388 | 8404 |
8389 #endif | 8405 #endif |
8390 | 8406 |
8391 | 8407 |
8392 #undef __ | 8408 #undef __ |
8393 | 8409 |
8394 } } // namespace v8::internal | 8410 } } // namespace v8::internal |
OLD | NEW |