Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: src/codegen-ia32.cc

Issue 17003: Update UnloadReference to use new virtual frame. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 // Anything else is a runtime error. 537 // Anything else is a runtime error.
538 LoadAndSpill(e); 538 LoadAndSpill(e);
539 frame_->CallRuntime(Runtime::kThrowReferenceError, 1); 539 frame_->CallRuntime(Runtime::kThrowReferenceError, 1);
540 } 540 }
541 } 541 }
542 542
543 543
544 void CodeGenerator::UnloadReference(Reference* ref) { 544 void CodeGenerator::UnloadReference(Reference* ref) {
545 // Pop a reference from the stack while preserving TOS. 545 // Pop a reference from the stack while preserving TOS.
546 Comment cmnt(masm_, "[ UnloadReference"); 546 Comment cmnt(masm_, "[ UnloadReference");
547 Result top(this);
547 int size = ref->size(); 548 int size = ref->size();
548 if (size == 1) { 549 if (size == 1) {
549 frame_->EmitPop(eax); 550 top = frame_->Pop();
550 __ mov(frame_->Top(), eax); 551 // Replace Drop(), Push() sequence with ReplaceTop().
552 frame_->Drop();
553 frame_->Push(&top);
551 } else if (size > 1) { 554 } else if (size > 1) {
552 frame_->EmitPop(eax); 555 top = frame_->Pop();
553 frame_->Drop(size); 556 frame_->Drop(size);
554 frame_->EmitPush(eax); 557 frame_->Push(&top);
555 } 558 }
556 } 559 }
557 560
558 561
559 class ToBooleanStub: public CodeStub { 562 class ToBooleanStub: public CodeStub {
560 public: 563 public:
561 ToBooleanStub() { } 564 ToBooleanStub() { }
562 565
563 void Generate(MacroAssembler* masm); 566 void Generate(MacroAssembler* masm);
564 567
(...skipping 5200 matching lines...) Expand 10 before | Expand all | Expand 10 after
5765 5768
5766 // Slow-case: Go through the JavaScript implementation. 5769 // Slow-case: Go through the JavaScript implementation.
5767 __ bind(&slow); 5770 __ bind(&slow);
5768 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5771 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5769 } 5772 }
5770 5773
5771 5774
5772 #undef __ 5775 #undef __
5773 5776
5774 } } // namespace v8::internal 5777 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698