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

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

Issue 16572: Adds Nip() function, makes UnloadReference() work without spilling (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 | src/virtual-frame-ia32.h » ('j') | 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 frame_->CallRuntime(Runtime::kThrowReferenceError, 1); 542 frame_->CallRuntime(Runtime::kThrowReferenceError, 1);
543 } 543 }
544 544
545 in_spilled_code_ = was_in_spilled_code; 545 in_spilled_code_ = was_in_spilled_code;
546 } 546 }
547 547
548 548
549 void CodeGenerator::UnloadReference(Reference* ref) { 549 void CodeGenerator::UnloadReference(Reference* ref) {
550 // Pop a reference from the stack while preserving TOS. 550 // Pop a reference from the stack while preserving TOS.
551 Comment cmnt(masm_, "[ UnloadReference"); 551 Comment cmnt(masm_, "[ UnloadReference");
552 int size = ref->size(); 552 frame_->Nip(ref->size());
553 if (size == 1) {
554 VirtualFrame::SpilledScope spilled_scope(this);
555 frame_->EmitPop(eax);
556 __ mov(frame_->Top(), eax);
557 } else if (size > 1) {
558 VirtualFrame::SpilledScope spilled_scope(this);
559 frame_->EmitPop(eax);
560 frame_->Drop(size);
561 frame_->EmitPush(eax);
562 }
563 } 553 }
564 554
565 555
566 class ToBooleanStub: public CodeStub { 556 class ToBooleanStub: public CodeStub {
567 public: 557 public:
568 ToBooleanStub() { } 558 ToBooleanStub() { }
569 559
570 void Generate(MacroAssembler* masm); 560 void Generate(MacroAssembler* masm);
571 561
572 private: 562 private:
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after
3107 LoadAndSpill(node->value()); 3097 LoadAndSpill(node->value());
3108 GenericBinaryOperation(node->binary_op(), node->type()); 3098 GenericBinaryOperation(node->binary_op(), node->type());
3109 } 3099 }
3110 } 3100 }
3111 3101
3112 Variable* var = node->target()->AsVariableProxy()->AsVariable(); 3102 Variable* var = node->target()->AsVariableProxy()->AsVariable();
3113 if (var != NULL && 3103 if (var != NULL &&
3114 var->mode() == Variable::CONST && 3104 var->mode() == Variable::CONST &&
3115 node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) { 3105 node->op() != Token::INIT_VAR && node->op() != Token::INIT_CONST) {
3116 // Assignment ignored - leave the value on the stack. 3106 // Assignment ignored - leave the value on the stack.
3117 } else { 3107 } else {
3118 CodeForSourcePosition(node->position()); 3108 CodeForSourcePosition(node->position());
3119 if (node->op() == Token::INIT_CONST) { 3109 if (node->op() == Token::INIT_CONST) {
3120 // Dynamic constant initializations must use the function context 3110 // Dynamic constant initializations must use the function context
3121 // and initialize the actual constant declared. Dynamic variable 3111 // and initialize the actual constant declared. Dynamic variable
3122 // initializations are simply assignments and use SetValue. 3112 // initializations are simply assignments and use SetValue.
3123 target.SetValue(CONST_INIT); 3113 target.SetValue(CONST_INIT);
3124 } else { 3114 } else {
3125 target.SetValue(NOT_CONST_INIT); 3115 target.SetValue(NOT_CONST_INIT);
3126 } 3116 }
3127 } 3117 }
(...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after
5977 5967
5978 // Slow-case: Go through the JavaScript implementation. 5968 // Slow-case: Go through the JavaScript implementation.
5979 __ bind(&slow); 5969 __ bind(&slow);
5980 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5970 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5981 } 5971 }
5982 5972
5983 5973
5984 #undef __ 5974 #undef __
5985 5975
5986 } } // namespace v8::internal 5976 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698