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

Side by Side Diff: src/hydrogen.h

Issue 10544196: Defer creating Handles for HConstants to the code generation phase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase & cosmetic changes. Created 8 years, 5 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/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 bool CheckConstPhiUses(); 280 bool CheckConstPhiUses();
281 281
282 void CollectPhis(); 282 void CollectPhis();
283 283
284 Handle<Code> Compile(); 284 Handle<Code> Compile();
285 285
286 void set_undefined_constant(HConstant* constant) { 286 void set_undefined_constant(HConstant* constant) {
287 undefined_constant_.set(constant); 287 undefined_constant_.set(constant);
288 } 288 }
289 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } 289 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); }
290 HConstant* GetConstantInt32(SetOncePointer<HConstant>* pointer,
291 int32_t integer_value);
290 HConstant* GetConstant1(); 292 HConstant* GetConstant1();
291 HConstant* GetConstantMinus1(); 293 HConstant* GetConstantMinus1();
292 HConstant* GetConstantTrue(); 294 HConstant* GetConstantTrue();
293 HConstant* GetConstantFalse(); 295 HConstant* GetConstantFalse();
294 HConstant* GetConstantHole(); 296 HConstant* GetConstantHole();
295 297
296 HBasicBlock* CreateBasicBlock(); 298 HBasicBlock* CreateBasicBlock();
297 HArgumentsObject* GetArgumentsObject() const { 299 HArgumentsObject* GetArgumentsObject() const {
298 return arguments_object_.get(); 300 return arguments_object_.get();
299 } 301 }
300 302
303 void EnsureConstantsHaveHandles() {
304 Factory* factory = isolate()->factory();
305 for (int i = 0; i < values_.length(); i++) {
306 if (values_[i]->IsConstant()) {
307 HConstant::cast(values_[i])->EnsureHasHandle(factory);
308 }
309 }
310 }
311
301 void SetArgumentsObject(HArgumentsObject* object) { 312 void SetArgumentsObject(HArgumentsObject* object) {
302 arguments_object_.set(object); 313 arguments_object_.set(object);
303 } 314 }
304 315
305 int GetMaximumValueID() const { return values_.length(); } 316 int GetMaximumValueID() const { return values_.length(); }
306 int GetNextBlockID() { return next_block_id_++; } 317 int GetNextBlockID() { return next_block_id_++; }
307 int GetNextValueID(HValue* value) { 318 int GetNextValueID(HValue* value) {
308 values_.Add(value, zone()); 319 values_.Add(value, zone());
309 return values_.length() - 1; 320 return values_.length() - 1;
310 } 321 }
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 HGraph* graph_; 1186 HGraph* graph_;
1176 HBasicBlock* current_block_; 1187 HBasicBlock* current_block_;
1177 1188
1178 int inlined_count_; 1189 int inlined_count_;
1179 ZoneList<Handle<Object> > globals_; 1190 ZoneList<Handle<Object> > globals_;
1180 1191
1181 Zone* zone_; 1192 Zone* zone_;
1182 1193
1183 bool inline_bailout_; 1194 bool inline_bailout_;
1184 1195
1196 HConstant* constant_undefined_;
1197 HConstant* constant_null_;
1198
1185 friend class FunctionState; // Pushes and pops the state stack. 1199 friend class FunctionState; // Pushes and pops the state stack.
1186 friend class AstContext; // Pushes and pops the AST context stack. 1200 friend class AstContext; // Pushes and pops the AST context stack.
1187 1201
1188 DISALLOW_COPY_AND_ASSIGN(HGraphBuilder); 1202 DISALLOW_COPY_AND_ASSIGN(HGraphBuilder);
1189 }; 1203 };
1190 1204
1191 1205
1192 Zone* AstContext::zone() const { return owner_->zone(); } 1206 Zone* AstContext::zone() const { return owner_->zone(); }
1193 1207
1194 1208
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 const char* filename_; 1441 const char* filename_;
1428 HeapStringAllocator string_allocator_; 1442 HeapStringAllocator string_allocator_;
1429 StringStream trace_; 1443 StringStream trace_;
1430 int indent_; 1444 int indent_;
1431 }; 1445 };
1432 1446
1433 1447
1434 } } // namespace v8::internal 1448 } } // namespace v8::internal
1435 1449
1436 #endif // V8_HYDROGEN_H_ 1450 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698