| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 910c25200ee3ec808f632a107078702138ea5d76..737a38dd6d2c0e9d142b76e5a06d756fdcde09e9 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -5225,29 +5225,54 @@ class DeoptimizationInputData: public FixedArray {
|
| }
|
| };
|
|
|
| +#if (defined(DEBUG) || defined(VERIFY_STACK_HEIGHT)) && V8_TARGET_ARCH_IA32
|
| +#define COMPARE_OPT_STACK_HEIGHT
|
| +#endif
|
|
|
| // 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
|
| +// The format of the these objects in release mode is
|
| // [i * 2]: Ast ID for ith deoptimization.
|
| // [i * 2 + 1]: PC and state of ith deoptimization
|
| +// In debug mode, we use 3 slots per deopt point, with the stack height
|
| +// information at [i * 3 + 2] slots
|
| class DeoptimizationOutputData: public FixedArray {
|
| public:
|
| - int DeoptPoints() { return length() / 2; }
|
| +#if defined(COMPARE_OPT_STACK_HEIGHT)
|
| + static const int kDeoptPointElementCount = 3;
|
| +
|
| + Smi* StackHeight(int index) {
|
| + return Smi::cast(get(2 + index * kDeoptPointElementCount));
|
| + }
|
| +
|
| + void SetStackHeight(int index, Smi* stack_height) {
|
| + set(2 + index * kDeoptPointElementCount, stack_height);
|
| + }
|
| +
|
| +#else
|
| + static const int kDeoptPointElementCount = 2;
|
| +#endif
|
| +
|
| + int DeoptPoints() { return length() / kDeoptPointElementCount; }
|
|
|
| BailoutId AstId(int index) {
|
| - return BailoutId(Smi::cast(get(index * 2))->value());
|
| + return BailoutId(Smi::cast(get(index * kDeoptPointElementCount))->value());
|
| }
|
|
|
| void SetAstId(int index, BailoutId id) {
|
| - set(index * 2, Smi::FromInt(id.ToInt()));
|
| + set(index * kDeoptPointElementCount, Smi::FromInt(id.ToInt()));
|
| }
|
|
|
| - Smi* PcAndState(int index) { return Smi::cast(get(1 + index * 2)); }
|
| - void SetPcAndState(int index, Smi* offset) { set(1 + index * 2, offset); }
|
| + Smi* PcAndState(int index) {
|
| + return Smi::cast(get(1 + index * kDeoptPointElementCount));
|
| + }
|
| +
|
| + void SetPcAndState(int index, Smi* offset) {
|
| + set(1 + index * kDeoptPointElementCount, offset);
|
| + }
|
|
|
| static int LengthOfFixedArray(int deopt_points) {
|
| - return deopt_points * 2;
|
| + return deopt_points * kDeoptPointElementCount;
|
| }
|
|
|
| // Allocates a DeoptimizationOutputData.
|
| @@ -7215,6 +7240,11 @@ class SharedFunctionInfo: public HeapObject {
|
| // disabled).
|
| bool VerifyBailoutId(BailoutId id);
|
|
|
| +#if defined(COMPARE_OPT_STACK_HEIGHT)
|
| + // Get expected stack height after deoptimization
|
| + int GetExpectedStackHeight(BailoutId id);
|
| +#endif
|
| +
|
| // [source code]: Source code for the function.
|
| bool HasSourceCode();
|
| Handle<Object> GetSourceCode();
|
|
|