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

Unified Diff: src/objects.h

Issue 504493002: Fix deoptimization address patching in Turbofan to use safepoints. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Compilation fix. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 3c814f2127a7c3b61e1cdcced83c6a060f7ddf63..a804dc62a6d41dd0fb0abdcf146a16db03981d5f 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5151,16 +5151,14 @@ TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS)
class DeoptimizationInputData: public FixedArray {
public:
// Layout description. Indices in the array.
- static const int kDeoptEntryCountIndex = 0;
- static const int kReturnAddressPatchEntryCountIndex = 1;
- static const int kTranslationByteArrayIndex = 2;
- static const int kInlinedFunctionCountIndex = 3;
- static const int kLiteralArrayIndex = 4;
- static const int kOsrAstIdIndex = 5;
- static const int kOsrPcOffsetIndex = 6;
- static const int kOptimizationIdIndex = 7;
- static const int kSharedFunctionInfoIndex = 8;
- static const int kFirstDeoptEntryIndex = 9;
+ static const int kTranslationByteArrayIndex = 0;
+ static const int kInlinedFunctionCountIndex = 1;
+ static const int kLiteralArrayIndex = 2;
+ static const int kOsrAstIdIndex = 3;
+ static const int kOsrPcOffsetIndex = 4;
+ static const int kOptimizationIdIndex = 5;
+ static const int kSharedFunctionInfoIndex = 6;
+ static const int kFirstDeoptEntryIndex = 7;
// Offsets of deopt entry elements relative to the start of the entry.
static const int kAstIdRawOffset = 0;
@@ -5169,12 +5167,6 @@ class DeoptimizationInputData: public FixedArray {
static const int kPcOffset = 3;
static const int kDeoptEntrySize = 4;
- // Offsets of return address patch entry elements relative to the start of the
- // entry
- static const int kReturnAddressPcOffset = 0;
- static const int kPatchedAddressPcOffset = 1;
- static const int kReturnAddressPatchEntrySize = 2;
-
// Simple element accessors.
#define DEFINE_ELEMENT_ACCESSORS(name, type) \
type* name() { \
@@ -5195,7 +5187,7 @@ class DeoptimizationInputData: public FixedArray {
#undef DEFINE_ELEMENT_ACCESSORS
// Accessors for elements of the ith deoptimization entry.
-#define DEFINE_DEOPT_ENTRY_ACCESSORS(name, type) \
+#define DEFINE_ENTRY_ACCESSORS(name, type) \
type* name(int i) { \
return type::cast(get(IndexForEntry(i) + k##name##Offset)); \
} \
@@ -5203,28 +5195,13 @@ class DeoptimizationInputData: public FixedArray {
set(IndexForEntry(i) + k##name##Offset, value); \
}
- DEFINE_DEOPT_ENTRY_ACCESSORS(AstIdRaw, Smi)
- DEFINE_DEOPT_ENTRY_ACCESSORS(TranslationIndex, Smi)
- DEFINE_DEOPT_ENTRY_ACCESSORS(ArgumentsStackHeight, Smi)
- DEFINE_DEOPT_ENTRY_ACCESSORS(Pc, Smi)
+ DEFINE_ENTRY_ACCESSORS(AstIdRaw, Smi)
+ DEFINE_ENTRY_ACCESSORS(TranslationIndex, Smi)
+ DEFINE_ENTRY_ACCESSORS(ArgumentsStackHeight, Smi)
+ DEFINE_ENTRY_ACCESSORS(Pc, Smi)
#undef DEFINE_DEOPT_ENTRY_ACCESSORS
-// Accessors for elements of the ith deoptimization entry.
-#define DEFINE_PATCH_ENTRY_ACCESSORS(name, type) \
- type* name(int i) { \
- return type::cast( \
- get(IndexForReturnAddressPatchEntry(i) + k##name##Offset)); \
- } \
- void Set##name(int i, type* value) { \
- set(IndexForReturnAddressPatchEntry(i) + k##name##Offset, value); \
- }
-
- DEFINE_PATCH_ENTRY_ACCESSORS(ReturnAddressPc, Smi)
- DEFINE_PATCH_ENTRY_ACCESSORS(PatchedAddressPc, Smi)
-
-#undef DEFINE_PATCH_ENTRY_ACCESSORS
-
BailoutId AstId(int i) {
return BailoutId(AstIdRaw(i)->value());
}
@@ -5234,19 +5211,12 @@ class DeoptimizationInputData: public FixedArray {
}
int DeoptCount() {
- return length() == 0 ? 0 : Smi::cast(get(kDeoptEntryCountIndex))->value();
- }
-
- int ReturnAddressPatchCount() {
- return length() == 0
- ? 0
- : Smi::cast(get(kReturnAddressPatchEntryCountIndex))->value();
+ return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
}
// Allocates a DeoptimizationInputData.
static Handle<DeoptimizationInputData> New(Isolate* isolate,
int deopt_entry_count,
- int return_address_patch_count,
PretenureFlag pretenure);
DECLARE_CAST(DeoptimizationInputData)
@@ -5256,21 +5226,12 @@ class DeoptimizationInputData: public FixedArray {
#endif
private:
- friend class Object; // For accessing LengthFor.
-
static int IndexForEntry(int i) {
return kFirstDeoptEntryIndex + (i * kDeoptEntrySize);
}
- int IndexForReturnAddressPatchEntry(int i) {
- return kFirstDeoptEntryIndex + (DeoptCount() * kDeoptEntrySize) +
- (i * kReturnAddressPatchEntrySize);
- }
- static int LengthFor(int deopt_count, int return_address_patch_count) {
- return kFirstDeoptEntryIndex + (deopt_count * kDeoptEntrySize) +
- (return_address_patch_count * kReturnAddressPatchEntrySize);
- }
+ static int LengthFor(int entry_count) { return IndexForEntry(entry_count); }
};
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698