OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 Load(e); | 600 Load(e); |
601 __ CallRuntime(Runtime::kThrowReferenceError, 1); | 601 __ CallRuntime(Runtime::kThrowReferenceError, 1); |
602 } | 602 } |
603 } | 603 } |
604 | 604 |
605 | 605 |
606 void CodeGenerator::UnloadReference(Reference* ref) { | 606 void CodeGenerator::UnloadReference(Reference* ref) { |
607 // Pop a reference from the stack while preserving TOS. | 607 // Pop a reference from the stack while preserving TOS. |
608 Comment cmnt(masm_, "[ UnloadReference"); | 608 Comment cmnt(masm_, "[ UnloadReference"); |
609 int size = ref->size(); | 609 int size = ref->size(); |
610 if (size <= 0) { | 610 if (size == 1) { |
611 // Do nothing. No popping is necessary. | |
612 } else if (size == 1) { | |
613 frame_->Pop(eax); | 611 frame_->Pop(eax); |
614 __ mov(frame_->Top(), eax); | 612 __ mov(frame_->Top(), eax); |
615 } else { | 613 } else if (size > 1) { |
616 frame_->Pop(eax); | 614 frame_->Pop(eax); |
617 frame_->Drop(size); | 615 frame_->Drop(size); |
618 frame_->Push(eax); | 616 frame_->Push(eax); |
619 } | 617 } |
620 } | 618 } |
621 | 619 |
622 | 620 |
623 class ToBooleanStub: public CodeStub { | 621 class ToBooleanStub: public CodeStub { |
624 public: | 622 public: |
625 ToBooleanStub() { } | 623 ToBooleanStub() { } |
(...skipping 4525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5151 | 5149 |
5152 // Slow-case: Go through the JavaScript implementation. | 5150 // Slow-case: Go through the JavaScript implementation. |
5153 __ bind(&slow); | 5151 __ bind(&slow); |
5154 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5152 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5155 } | 5153 } |
5156 | 5154 |
5157 | 5155 |
5158 #undef __ | 5156 #undef __ |
5159 | 5157 |
5160 } } // namespace v8::internal | 5158 } } // namespace v8::internal |
OLD | NEW |