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

Unified Diff: src/objects.h

Issue 2451853002: Uniform and precise source positions for inlining (Closed)
Patch Set: fixed PodArray::copy_out Created 4 years, 1 month 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index ef3f31df4793aefb3cdfbc7012a9c889589b8fb7..a7eda757d609b82553b88673ae6971b22bd17d2c 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -168,6 +168,8 @@
namespace v8 {
namespace internal {
+struct InliningPosition;
+
enum KeyedAccessStoreMode {
STANDARD_STORE,
STORE_TRANSITION_TO_OBJECT,
@@ -4955,6 +4957,30 @@ class ByteArray: public FixedArrayBase {
DISALLOW_IMPLICIT_CONSTRUCTORS(ByteArray);
};
+// Wrapper class for ByteArray which can store arbitrary C++ classes, as long
+// as they can be copied with memcpy.
+template <class T>
+class PodArray : public ByteArray {
+ public:
+ void copy_out(int index, T* result) {
+ ByteArray::copy_out(index * sizeof(T), reinterpret_cast<byte*>(result),
+ sizeof(T));
+ }
+ T get(int index) {
+ T result;
+ copy_out(index, &result);
+ return result;
+ }
+ void set(int index, const T& value) {
+ copy_in(index * sizeof(T), reinterpret_cast<const byte*>(&value),
+ sizeof(T));
+ }
+ int length() { return ByteArray::length() / sizeof(T); }
+ DECLARE_CAST(PodArray<T>);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PodArray<T>);
+};
// BytecodeArray represents a sequence of interpreter bytecodes.
class BytecodeArray : public FixedArrayBase {
@@ -5187,7 +5213,6 @@ TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS)
#undef FIXED_TYPED_ARRAY_TRAITS
-
// DeoptimizationInputData is a fixed array used to hold the deoptimization
// data for code generated by the Hydrogen/Lithium compiler. It also
// contains information about functions that were inlined. If N different
@@ -5206,7 +5231,8 @@ class DeoptimizationInputData: public FixedArray {
static const int kOptimizationIdIndex = 5;
static const int kSharedFunctionInfoIndex = 6;
static const int kWeakCellCacheIndex = 7;
- static const int kFirstDeoptEntryIndex = 8;
+ static const int kInliningPositionsIndex = 8;
+ static const int kFirstDeoptEntryIndex = 9;
// Offsets of deopt entry elements relative to the start of the entry.
static const int kAstIdRawOffset = 0;
@@ -5228,6 +5254,7 @@ class DeoptimizationInputData: public FixedArray {
DECLARE_ELEMENT_ACCESSORS(OptimizationId, Smi)
DECLARE_ELEMENT_ACCESSORS(SharedFunctionInfo, Object)
DECLARE_ELEMENT_ACCESSORS(WeakCellCache, Object)
+ DECLARE_ELEMENT_ACCESSORS(InliningPositions, PodArray<InliningPosition>)
#undef DECLARE_ELEMENT_ACCESSORS
@@ -5269,7 +5296,6 @@ class DeoptimizationInputData: public FixedArray {
static int LengthFor(int entry_count) { return IndexForEntry(entry_count); }
};
-
// DeoptimizationOutputData is a fixed array used to hold the deoptimization
// data for code generated by the full compiler.
// The format of the these objects is

Powered by Google App Engine
This is Rietveld 408576698