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

Side by Side Diff: src/objects.h

Issue 159783002: Re-optimize faster after making a pretenuring decision. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 5279 matching lines...) Expand 10 before | Expand all | Expand 10 after
5290 // cache is passed to the stub. 5290 // cache is passed to the stub.
5291 inline bool has_function_cache(); 5291 inline bool has_function_cache();
5292 inline void set_has_function_cache(bool flag); 5292 inline void set_has_function_cache(bool flag);
5293 5293
5294 5294
5295 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether 5295 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether
5296 // the code is going to be deoptimized because of dead embedded maps. 5296 // the code is going to be deoptimized because of dead embedded maps.
5297 inline bool marked_for_deoptimization(); 5297 inline bool marked_for_deoptimization();
5298 inline void set_marked_for_deoptimization(bool flag); 5298 inline void set_marked_for_deoptimization(bool flag);
5299 5299
5300 inline bool marked_for_reoptimization();
5301 inline void set_marked_for_reoptimization(bool flag);
5302
5300 // [constant_pool]: The constant pool for this function. 5303 // [constant_pool]: The constant pool for this function.
5301 inline ConstantPoolArray* constant_pool(); 5304 inline ConstantPoolArray* constant_pool();
5302 inline void set_constant_pool(Object* constant_pool); 5305 inline void set_constant_pool(Object* constant_pool);
5303 5306
5304 // Get the safepoint entry for the given pc. 5307 // Get the safepoint entry for the given pc.
5305 SafepointEntry GetSafepointEntry(Address pc); 5308 SafepointEntry GetSafepointEntry(Address pc);
5306 5309
5307 // Find an object in a stub with a specified map 5310 // Find an object in a stub with a specified map
5308 Object* FindNthObject(int n, Map* match_map); 5311 Object* FindNthObject(int n, Map* match_map);
5309 void ReplaceNthObject(int n, Map* match_map, Object* replace_with); 5312 void ReplaceNthObject(int n, Map* match_map, Object* replace_with);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
5463 // Gets the raw code age, including psuedo code-age values such as 5466 // Gets the raw code age, including psuedo code-age values such as
5464 // kNotExecutedCodeAge and kExecutedOnceCodeAge. 5467 // kNotExecutedCodeAge and kExecutedOnceCodeAge.
5465 Age GetRawAge(); 5468 Age GetRawAge();
5466 static inline Code* GetPreAgedCodeAgeStub(Isolate* isolate) { 5469 static inline Code* GetPreAgedCodeAgeStub(Isolate* isolate) {
5467 return GetCodeAgeStub(isolate, kNotExecutedCodeAge, NO_MARKING_PARITY); 5470 return GetCodeAgeStub(isolate, kNotExecutedCodeAge, NO_MARKING_PARITY);
5468 } 5471 }
5469 5472
5470 void PrintDeoptLocation(FILE* out, int bailout_id); 5473 void PrintDeoptLocation(FILE* out, int bailout_id);
5471 bool CanDeoptAt(Address pc); 5474 bool CanDeoptAt(Address pc);
5472 5475
5476 void GetICCounts(int* ic_with_type_info_count,
titzer 2014/02/18 09:24:48 Nit: formatting
Hannes Payer (out of office) 2014/05/12 09:37:08 Done.
5477 int* ic_total_count,
5478 int* percentage);
5479
5473 #ifdef VERIFY_HEAP 5480 #ifdef VERIFY_HEAP
5474 void VerifyEmbeddedObjectsDependency(); 5481 void VerifyEmbeddedObjectsDependency();
5475 #endif 5482 #endif
5476 5483
5477 static bool IsWeakEmbeddedObject(Kind kind, Object* object); 5484 static bool IsWeakEmbeddedObject(Kind kind, Object* object);
5478 5485
5479 // Max loop nesting marker used to postpose OSR. We don't take loop 5486 // Max loop nesting marker used to postpose OSR. We don't take loop
5480 // nesting that is deeper than 5 levels into account. 5487 // nesting that is deeper than 5 levels into account.
5481 static const int kMaxLoopNestingMarker = 6; 5488 static const int kMaxLoopNestingMarker = 6;
5482 5489
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
5532 5539
5533 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) 5540 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION)
5534 static const int kStackSlotsFirstBit = 0; 5541 static const int kStackSlotsFirstBit = 0;
5535 static const int kStackSlotsBitCount = 24; 5542 static const int kStackSlotsBitCount = 24;
5536 static const int kHasFunctionCacheFirstBit = 5543 static const int kHasFunctionCacheFirstBit =
5537 kStackSlotsFirstBit + kStackSlotsBitCount; 5544 kStackSlotsFirstBit + kStackSlotsBitCount;
5538 static const int kHasFunctionCacheBitCount = 1; 5545 static const int kHasFunctionCacheBitCount = 1;
5539 static const int kMarkedForDeoptimizationFirstBit = 5546 static const int kMarkedForDeoptimizationFirstBit =
5540 kStackSlotsFirstBit + kStackSlotsBitCount + 1; 5547 kStackSlotsFirstBit + kStackSlotsBitCount + 1;
5541 static const int kMarkedForDeoptimizationBitCount = 1; 5548 static const int kMarkedForDeoptimizationBitCount = 1;
5549 static const int kMarkedForReoptimizationFirstBit =
5550 kMarkedForDeoptimizationFirstBit + kMarkedForDeoptimizationBitCount + 1;
5551 static const int kMarkedForReoptimizationBitCount = 1;
5542 5552
5543 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); 5553 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32);
5544 STATIC_ASSERT(kHasFunctionCacheFirstBit + kHasFunctionCacheBitCount <= 32); 5554 STATIC_ASSERT(kHasFunctionCacheFirstBit + kHasFunctionCacheBitCount <= 32);
5545 STATIC_ASSERT(kMarkedForDeoptimizationFirstBit + 5555 STATIC_ASSERT(kMarkedForDeoptimizationFirstBit +
5546 kMarkedForDeoptimizationBitCount <= 32); 5556 kMarkedForDeoptimizationBitCount <= 32);
5557 STATIC_ASSERT(kMarkedForReoptimizationFirstBit +
5558 kMarkedForReoptimizationBitCount <= 32);
5547 5559
5548 class StackSlotsField: public BitField<int, 5560 class StackSlotsField: public BitField<int,
5549 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT 5561 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT
5550 class HasFunctionCacheField: public BitField<bool, 5562 class HasFunctionCacheField: public BitField<bool,
5551 kHasFunctionCacheFirstBit, kHasFunctionCacheBitCount> {}; // NOLINT 5563 kHasFunctionCacheFirstBit, kHasFunctionCacheBitCount> {}; // NOLINT
5552 class MarkedForDeoptimizationField: public BitField<bool, 5564 class MarkedForDeoptimizationField: public BitField<bool,
5553 kMarkedForDeoptimizationFirstBit, 5565 kMarkedForDeoptimizationFirstBit,
5554 kMarkedForDeoptimizationBitCount> {}; // NOLINT 5566 kMarkedForDeoptimizationBitCount> {}; // NOLINT
5567 class MarkedForReoptimizationField: public BitField<bool,
5568 kMarkedForReoptimizationFirstBit,
5569 kMarkedForReoptimizationBitCount> {}; // NOLINT
5555 5570
5556 // KindSpecificFlags2 layout (ALL) 5571 // KindSpecificFlags2 layout (ALL)
5557 static const int kIsCrankshaftedBit = 0; 5572 static const int kIsCrankshaftedBit = 0;
5558 class IsCrankshaftedField: public BitField<bool, 5573 class IsCrankshaftedField: public BitField<bool,
5559 kIsCrankshaftedBit, 1> {}; // NOLINT 5574 kIsCrankshaftedBit, 1> {}; // NOLINT
5560 5575
5561 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) 5576 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION)
5562 static const int kStubMajorKeyFirstBit = kIsCrankshaftedBit + 1; 5577 static const int kStubMajorKeyFirstBit = kIsCrankshaftedBit + 1;
5563 static const int kSafepointTableOffsetFirstBit = 5578 static const int kSafepointTableOffsetFirstBit =
5564 kStubMajorKeyFirstBit + kStubMajorKeyBits; 5579 kStubMajorKeyFirstBit + kStubMajorKeyBits;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5691 void UpdateToFinishedCode(DependencyGroup group, 5706 void UpdateToFinishedCode(DependencyGroup group,
5692 CompilationInfo* info, 5707 CompilationInfo* info,
5693 Code* code); 5708 Code* code);
5694 void RemoveCompilationInfo(DependentCode::DependencyGroup group, 5709 void RemoveCompilationInfo(DependentCode::DependencyGroup group,
5695 CompilationInfo* info); 5710 CompilationInfo* info);
5696 5711
5697 void DeoptimizeDependentCodeGroup(Isolate* isolate, 5712 void DeoptimizeDependentCodeGroup(Isolate* isolate,
5698 DependentCode::DependencyGroup group); 5713 DependentCode::DependencyGroup group);
5699 5714
5700 bool MarkCodeForDeoptimization(Isolate* isolate, 5715 bool MarkCodeForDeoptimization(Isolate* isolate,
5701 DependentCode::DependencyGroup group); 5716 DependentCode::DependencyGroup group,
5717 bool reoptimize = false);
5702 5718
5703 // The following low-level accessors should only be used by this class 5719 // The following low-level accessors should only be used by this class
5704 // and the mark compact collector. 5720 // and the mark compact collector.
5705 inline int number_of_entries(DependencyGroup group); 5721 inline int number_of_entries(DependencyGroup group);
5706 inline void set_number_of_entries(DependencyGroup group, int value); 5722 inline void set_number_of_entries(DependencyGroup group, int value);
5707 inline bool is_code_at(int i); 5723 inline bool is_code_at(int i);
5708 inline Code* code_at(int i); 5724 inline Code* code_at(int i);
5709 inline CompilationInfo* compilation_info_at(int i); 5725 inline CompilationInfo* compilation_info_at(int i);
5710 inline void set_object_at(int i, Object* object); 5726 inline void set_object_at(int i, Object* object);
5711 inline Object** slot_at(int i); 5727 inline Object** slot_at(int i);
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
7448 7464
7449 // Returns the number of allocated literals. 7465 // Returns the number of allocated literals.
7450 inline int NumberOfLiterals(); 7466 inline int NumberOfLiterals();
7451 7467
7452 // Retrieve the native context from a function's literal array. 7468 // Retrieve the native context from a function's literal array.
7453 static Context* NativeContextFromLiterals(FixedArray* literals); 7469 static Context* NativeContextFromLiterals(FixedArray* literals);
7454 7470
7455 // Used for flags such as --hydrogen-filter. 7471 // Used for flags such as --hydrogen-filter.
7456 bool PassesFilter(const char* raw_filter); 7472 bool PassesFilter(const char* raw_filter);
7457 7473
7474 void Optimize(const char* reason);
titzer 2014/02/18 09:24:48 Please move this to the compiler. Yang did a big r
Hannes Payer (out of office) 2014/05/12 09:37:08 Done.
7475
7458 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to 7476 // Layout descriptors. The last property (from kNonWeakFieldsEndOffset to
7459 // kSize) is weak and has special handling during garbage collection. 7477 // kSize) is weak and has special handling during garbage collection.
7460 static const int kCodeEntryOffset = JSObject::kHeaderSize; 7478 static const int kCodeEntryOffset = JSObject::kHeaderSize;
7461 static const int kPrototypeOrInitialMapOffset = 7479 static const int kPrototypeOrInitialMapOffset =
7462 kCodeEntryOffset + kPointerSize; 7480 kCodeEntryOffset + kPointerSize;
7463 static const int kSharedFunctionInfoOffset = 7481 static const int kSharedFunctionInfoOffset =
7464 kPrototypeOrInitialMapOffset + kPointerSize; 7482 kPrototypeOrInitialMapOffset + kPointerSize;
7465 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; 7483 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize;
7466 static const int kLiteralsOffset = kContextOffset + kPointerSize; 7484 static const int kLiteralsOffset = kContextOffset + kPointerSize;
7467 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize; 7485 static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize;
(...skipping 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after
10734 } else { 10752 } else {
10735 value &= ~(1 << bit_position); 10753 value &= ~(1 << bit_position);
10736 } 10754 }
10737 return value; 10755 return value;
10738 } 10756 }
10739 }; 10757 };
10740 10758
10741 } } // namespace v8::internal 10759 } } // namespace v8::internal
10742 10760
10743 #endif // V8_OBJECTS_H_ 10761 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698