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

Side by Side Diff: src/compiler.h

Issue 16925008: Generate StoreGlobal stubs with Hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Finish code dependencies Created 7 years, 6 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 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 // Disable all optimization attempts of this info for the rest of the 233 // Disable all optimization attempts of this info for the rest of the
234 // current compilation pipeline. 234 // current compilation pipeline.
235 void AbortOptimization(); 235 void AbortOptimization();
236 236
237 void set_deferred_handles(DeferredHandles* deferred_handles) { 237 void set_deferred_handles(DeferredHandles* deferred_handles) {
238 ASSERT(deferred_handles_ == NULL); 238 ASSERT(deferred_handles_ == NULL);
239 deferred_handles_ = deferred_handles; 239 deferred_handles_ = deferred_handles;
240 } 240 }
241 241
242 ZoneList<Handle<Map> >* dependent_maps(DependentCode::DependencyGroup group) { 242 ZoneList<Handle<HeapObject> >* dependencies(
243 if (dependent_maps_[group] == NULL) { 243 DependentCode::DependencyGroup group) {
244 dependent_maps_[group] = new(zone_) ZoneList<Handle<Map> >(2, zone_); 244 if (dependencies_[group] == NULL) {
245 dependencies_[group] = new(zone_) ZoneList<Handle<HeapObject> >(2, zone_);
245 } 246 }
246 return dependent_maps_[group]; 247 return dependencies_[group];
247 } 248 }
248 249
249 void CommitDependentMaps(Handle<Code> code); 250 void CommitDependencies(Handle<Code> code);
250 251
251 void RollbackDependentMaps(); 252 void RollbackDependencies();
252 253
253 void SaveHandles() { 254 void SaveHandles() {
254 SaveHandle(&closure_); 255 SaveHandle(&closure_);
255 SaveHandle(&shared_info_); 256 SaveHandle(&shared_info_);
256 SaveHandle(&context_); 257 SaveHandle(&context_);
257 SaveHandle(&script_); 258 SaveHandle(&script_);
258 } 259 }
259 260
260 const char* bailout_reason() const { return bailout_reason_; } 261 const char* bailout_reason() const { return bailout_reason_; }
261 void set_bailout_reason(const char* reason) { bailout_reason_ = reason; } 262 void set_bailout_reason(const char* reason) { bailout_reason_ = reason; }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // Compilation mode flag and whether deoptimization is allowed. 391 // Compilation mode flag and whether deoptimization is allowed.
391 Mode mode_; 392 Mode mode_;
392 BailoutId osr_ast_id_; 393 BailoutId osr_ast_id_;
393 394
394 // The zone from which the compilation pipeline working on this 395 // The zone from which the compilation pipeline working on this
395 // CompilationInfo allocates. 396 // CompilationInfo allocates.
396 Zone* zone_; 397 Zone* zone_;
397 398
398 DeferredHandles* deferred_handles_; 399 DeferredHandles* deferred_handles_;
399 400
400 ZoneList<Handle<Map> >* dependent_maps_[DependentCode::kGroupCount]; 401 ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount];
401 402
402 template<typename T> 403 template<typename T>
403 void SaveHandle(Handle<T> *object) { 404 void SaveHandle(Handle<T> *object) {
404 if (!object->is_null()) { 405 if (!object->is_null()) {
405 Handle<T> handle(*(*object)); 406 Handle<T> handle(*(*object));
406 *object = handle; 407 *object = handle;
407 } 408 }
408 } 409 }
409 410
410 const char* bailout_reason_; 411 const char* bailout_reason_;
(...skipping 30 matching lines...) Expand all
441 zone_scope_(&zone_, DELETE_ON_EXIT) {} 442 zone_scope_(&zone_, DELETE_ON_EXIT) {}
442 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate) 443 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate)
443 : CompilationInfo(stub, isolate, &zone_), 444 : CompilationInfo(stub, isolate, &zone_),
444 zone_(isolate), 445 zone_(isolate),
445 zone_scope_(&zone_, DELETE_ON_EXIT) {} 446 zone_scope_(&zone_, DELETE_ON_EXIT) {}
446 447
447 // Virtual destructor because a CompilationInfoWithZone has to exit the 448 // Virtual destructor because a CompilationInfoWithZone has to exit the
448 // zone scope and get rid of dependent maps even when the destructor is 449 // zone scope and get rid of dependent maps even when the destructor is
449 // called when cast as a CompilationInfo. 450 // called when cast as a CompilationInfo.
450 virtual ~CompilationInfoWithZone() { 451 virtual ~CompilationInfoWithZone() {
451 RollbackDependentMaps(); 452 RollbackDependencies();
452 } 453 }
453 454
454 private: 455 private:
455 Zone zone_; 456 Zone zone_;
456 ZoneScope zone_scope_; 457 ZoneScope zone_scope_;
457 }; 458 };
458 459
459 460
460 // A wrapper around a CompilationInfo that detaches the Handles from 461 // A wrapper around a CompilationInfo that detaches the Handles from
461 // the underlying DeferredHandleScope and stores them in info_ on 462 // the underlying DeferredHandleScope and stores them in info_ on
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 614
614 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, 615 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
615 CompilationInfo* info, 616 CompilationInfo* info,
616 Handle<SharedFunctionInfo> shared); 617 Handle<SharedFunctionInfo> shared);
617 }; 618 };
618 619
619 620
620 } } // namespace v8::internal 621 } } // namespace v8::internal
621 622
622 #endif // V8_COMPILER_H_ 623 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/compiler.cc » ('j') | src/types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698