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 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 1997 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
1998 | 1998 |
1999 Label true_value, done; | 1999 Label true_value, done; |
2000 __ tst(r0, r0); | 2000 __ tst(r0, r0); |
2001 __ mov(r0, Operand(Factory::false_value()), LeaveCC, ne); | 2001 __ mov(r0, Operand(Factory::false_value()), LeaveCC, ne); |
2002 __ mov(r0, Operand(Factory::true_value()), LeaveCC, eq); | 2002 __ mov(r0, Operand(Factory::true_value()), LeaveCC, eq); |
2003 } | 2003 } |
2004 | 2004 |
2005 | 2005 |
2006 void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) { | 2006 void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) { |
2007 Abort("DoInstanceOfAndBranch unimplemented."); | 2007 ASSERT(ToRegister(instr->InputAt(0)).is(r0)); // Object is in r0. |
| 2008 ASSERT(ToRegister(instr->InputAt(1)).is(r1)); // Function is in r1. |
| 2009 |
| 2010 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 2011 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 2012 |
| 2013 InstanceofStub stub(InstanceofStub::kArgsInRegisters); |
| 2014 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 2015 __ tst(r0, Operand(r0)); |
| 2016 EmitBranch(true_block, false_block, eq); |
2008 } | 2017 } |
2009 | 2018 |
2010 | 2019 |
2011 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 2020 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
2012 class DeferredInstanceOfKnownGlobal: public LDeferredCode { | 2021 class DeferredInstanceOfKnownGlobal: public LDeferredCode { |
2013 public: | 2022 public: |
2014 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 2023 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
2015 LInstanceOfKnownGlobal* instr) | 2024 LInstanceOfKnownGlobal* instr) |
2016 : LDeferredCode(codegen), instr_(instr) { } | 2025 : LDeferredCode(codegen), instr_(instr) { } |
2017 virtual void Generate() { | 2026 virtual void Generate() { |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3674 | 3683 |
3675 | 3684 |
3676 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3685 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3677 Abort("DoOsrEntry unimplemented."); | 3686 Abort("DoOsrEntry unimplemented."); |
3678 } | 3687 } |
3679 | 3688 |
3680 | 3689 |
3681 #undef __ | 3690 #undef __ |
3682 | 3691 |
3683 } } // namespace v8::internal | 3692 } } // namespace v8::internal |
OLD | NEW |