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

Side by Side Diff: src/scopeinfo.cc

Issue 7826009: Support declarations of context allocated locals in Crankshaft. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 } else { 126 } else {
127 ASSERT(heap_locals.length() == 0); 127 ASSERT(heap_locals.length() == 0);
128 } 128 }
129 129
130 // Add the function context slot, if present. 130 // Add the function context slot, if present.
131 // For now, this must happen at the very end because of the 131 // For now, this must happen at the very end because of the
132 // ordering of the scope info slots and the respective slot indices. 132 // ordering of the scope info slots and the respective slot indices.
133 if (scope->is_function_scope()) { 133 if (scope->is_function_scope()) {
134 Variable* var = scope->function(); 134 VariableProxy* proxy = scope->function();
135 if (var != NULL && 135 if (proxy != NULL &&
136 var->is_used() && 136 proxy->var()->is_used() &&
137 var->AsSlot()->type() == Slot::CONTEXT) { 137 proxy->var()->AsSlot()->type() == Slot::CONTEXT) {
Kevin Millikin (Chromium) 2011/09/01 15:40:58 proxy->var()->IsContextSlot()
fschneider 2011/09/01 16:28:21 Done.
138 function_name_ = var->name(); 138 function_name_ = proxy->var()->name();
Kevin Millikin (Chromium) 2011/09/01 15:40:58 function_name_ = proxy->name();
fschneider 2011/09/01 16:28:21 Done.
139 // Note that we must not find the function name in the context slot 139 // Note that we must not find the function name in the context slot
140 // list - instead it must be handled separately in the 140 // list - instead it must be handled separately in the
141 // Contexts::Lookup() function. Thus record an empty symbol here so we 141 // Contexts::Lookup() function. Thus record an empty symbol here so we
142 // get the correct number of context slots. 142 // get the correct number of context slots.
143 ASSERT(var->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS == 143 ASSERT(proxy->var()->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
144 context_slots_.length()); 144 context_slots_.length());
145 ASSERT(var->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS == 145 ASSERT(proxy->var()->AsSlot()->index() - Context::MIN_CONTEXT_SLOTS ==
146 context_modes_.length()); 146 context_modes_.length());
147 context_slots_.Add(FACTORY->empty_symbol()); 147 context_slots_.Add(FACTORY->empty_symbol());
148 context_modes_.Add(Variable::INTERNAL); 148 context_modes_.Add(Variable::INTERNAL);
149 } 149 }
150 } 150 }
151 } 151 }
152 152
153 153
154 // Encoding format in a FixedArray object: 154 // Encoding format in a FixedArray object:
155 // 155 //
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 639 }
640 #endif // DEBUG 640 #endif // DEBUG
641 641
642 642
643 // Make sure the classes get instantiated by the template system. 643 // Make sure the classes get instantiated by the template system.
644 template class ScopeInfo<FreeStoreAllocationPolicy>; 644 template class ScopeInfo<FreeStoreAllocationPolicy>;
645 template class ScopeInfo<PreallocatedStorage>; 645 template class ScopeInfo<PreallocatedStorage>;
646 template class ScopeInfo<ZoneListAllocationPolicy>; 646 template class ScopeInfo<ZoneListAllocationPolicy>;
647 647
648 } } // namespace v8::internal 648 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698