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

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

Issue 17412: Experimental: a quick hack to allow different live values to flow down... (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 | « src/codegen-ia32.h ('k') | src/jump-target-ia32.cc » ('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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 allocator_(NULL), 83 allocator_(NULL),
84 cc_reg_(no_condition), 84 cc_reg_(no_condition),
85 state_(NULL), 85 state_(NULL),
86 break_stack_height_(0), 86 break_stack_height_(0),
87 loop_nesting_(0), 87 loop_nesting_(0),
88 function_return_is_shadowed_(false), 88 function_return_is_shadowed_(false),
89 in_spilled_code_(false) { 89 in_spilled_code_(false) {
90 } 90 }
91 91
92 92
93 void CodeGenerator::SetFrame(VirtualFrame* new_frame) { 93 void CodeGenerator::SetFrame(VirtualFrame* new_frame,
94 RegisterFile* non_frame_registers) {
95 RegisterFile saved_counts;
94 if (has_valid_frame()) { 96 if (has_valid_frame()) {
95 frame_->DetachFromCodeGenerator(); 97 frame_->DetachFromCodeGenerator();
98 // The remaining register reference counts are the non-frame ones.
99 allocator_->SaveTo(&saved_counts);
96 } 100 }
101
97 if (new_frame != NULL) { 102 if (new_frame != NULL) {
103 // Restore the non-frame register references that go with the new frame.
104 allocator_->RestoreFrom(non_frame_registers);
98 new_frame->AttachToCodeGenerator(); 105 new_frame->AttachToCodeGenerator();
99 } 106 }
107
100 frame_ = new_frame; 108 frame_ = new_frame;
109 saved_counts.CopyTo(non_frame_registers);
101 } 110 }
102 111
103 112
104 void CodeGenerator::DeleteFrame() { 113 void CodeGenerator::DeleteFrame() {
105 if (has_valid_frame()) { 114 if (has_valid_frame()) {
106 frame_->DetachFromCodeGenerator(); 115 frame_->DetachFromCodeGenerator();
107 delete frame_; 116 delete frame_;
108 frame_ = NULL; 117 frame_ = NULL;
109 } 118 }
110 } 119 }
(...skipping 11 matching lines...) Expand all
122 131
123 ZoneList<Statement*>* body = fun->body(); 132 ZoneList<Statement*>* body = fun->body();
124 133
125 // Initialize state. 134 // Initialize state.
126 ASSERT(scope_ == NULL); 135 ASSERT(scope_ == NULL);
127 scope_ = fun->scope(); 136 scope_ = fun->scope();
128 ASSERT(allocator_ == NULL); 137 ASSERT(allocator_ == NULL);
129 RegisterAllocator register_allocator(this); 138 RegisterAllocator register_allocator(this);
130 allocator_ = &register_allocator; 139 allocator_ = &register_allocator;
131 ASSERT(frame_ == NULL); 140 ASSERT(frame_ == NULL);
132 SetFrame(new VirtualFrame(this)); 141 frame_ = new VirtualFrame(this);
133 cc_reg_ = no_condition; 142 cc_reg_ = no_condition;
134 function_return_.set_code_generator(this); 143 function_return_.set_code_generator(this);
135 function_return_is_shadowed_ = false; 144 function_return_is_shadowed_ = false;
136 set_in_spilled_code(false); 145 set_in_spilled_code(false);
137 146
138 // Adjust for function-level loop nesting. 147 // Adjust for function-level loop nesting.
139 loop_nesting_ += fun->loop_nesting(); 148 loop_nesting_ += fun->loop_nesting();
140 149
141 { 150 {
142 CodeGenState state(this); 151 CodeGenState state(this);
(...skipping 5849 matching lines...) Expand 10 before | Expand all | Expand 10 after
5992 6001
5993 // Slow-case: Go through the JavaScript implementation. 6002 // Slow-case: Go through the JavaScript implementation.
5994 __ bind(&slow); 6003 __ bind(&slow);
5995 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 6004 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5996 } 6005 }
5997 6006
5998 6007
5999 #undef __ 6008 #undef __
6000 6009
6001 } } // namespace v8::internal 6010 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-ia32.h ('k') | src/jump-target-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698