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

Side by Side Diff: src/objects.h

Issue 2534893002: [runtime] Simplify handler table lookup semantics. (Closed)
Patch Set: Rebased. Created 4 years 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
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 4799 matching lines...) Expand 10 before | Expand all | Expand 10 after
4810 // Setters for handler table based on ranges. 4810 // Setters for handler table based on ranges.
4811 inline void SetRangeStart(int index, int value); 4811 inline void SetRangeStart(int index, int value);
4812 inline void SetRangeEnd(int index, int value); 4812 inline void SetRangeEnd(int index, int value);
4813 inline void SetRangeHandler(int index, int offset, CatchPrediction pred); 4813 inline void SetRangeHandler(int index, int offset, CatchPrediction pred);
4814 inline void SetRangeData(int index, int value); 4814 inline void SetRangeData(int index, int value);
4815 4815
4816 // Setters for handler table based on return addresses. 4816 // Setters for handler table based on return addresses.
4817 inline void SetReturnOffset(int index, int value); 4817 inline void SetReturnOffset(int index, int value);
4818 inline void SetReturnHandler(int index, int offset); 4818 inline void SetReturnHandler(int index, int offset);
4819 4819
4820 // Lookup handler in a table based on ranges. 4820 // Lookup handler in a table based on ranges. The {pc_offset} is an offset to
4821 // the start of the potentially throwing instruction (using return addresses
4822 // for this value would be invalid).
4821 int LookupRange(int pc_offset, int* data, CatchPrediction* prediction); 4823 int LookupRange(int pc_offset, int* data, CatchPrediction* prediction);
4822 4824
4823 // Lookup handler in a table based on return addresses. 4825 // Lookup handler in a table based on return addresses.
4824 int LookupReturn(int pc_offset); 4826 int LookupReturn(int pc_offset);
4825 4827
4826 // Returns the number of entries in the table. 4828 // Returns the number of entries in the table.
4827 inline int NumberOfRangeEntries() const; 4829 inline int NumberOfRangeEntries() const;
4828 4830
4829 // Returns the required length of the underlying fixed array. 4831 // Returns the required length of the underlying fixed array.
4830 static int LengthForRange(int entries) { return entries * kRangeEntrySize; } 4832 static int LengthForRange(int entries) { return entries * kRangeEntrySize; }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
4995 int SourcePosition(int offset); 4997 int SourcePosition(int offset);
4996 int SourceStatementPosition(int offset); 4998 int SourceStatementPosition(int offset);
4997 4999
4998 DECLARE_PRINTER(BytecodeArray) 5000 DECLARE_PRINTER(BytecodeArray)
4999 DECLARE_VERIFIER(BytecodeArray) 5001 DECLARE_VERIFIER(BytecodeArray)
5000 5002
5001 void Disassemble(std::ostream& os); 5003 void Disassemble(std::ostream& os);
5002 5004
5003 void CopyBytecodesTo(BytecodeArray* to); 5005 void CopyBytecodesTo(BytecodeArray* to);
5004 5006
5005 int LookupRangeInHandlerTable(int code_offset, int* data,
5006 HandlerTable::CatchPrediction* prediction);
5007
5008 // Layout description. 5007 // Layout description.
5009 static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize; 5008 static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize;
5010 static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize; 5009 static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize;
5011 static const int kSourcePositionTableOffset = 5010 static const int kSourcePositionTableOffset =
5012 kHandlerTableOffset + kPointerSize; 5011 kHandlerTableOffset + kPointerSize;
5013 static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize; 5012 static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize;
5014 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; 5013 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize;
5015 static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize; 5014 static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize;
5016 static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize; 5015 static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize;
5017 static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize; 5016 static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize;
(...skipping 6894 matching lines...) Expand 10 before | Expand all | Expand 10 after
11912 } 11911 }
11913 return value; 11912 return value;
11914 } 11913 }
11915 }; 11914 };
11916 11915
11917 11916
11918 } // NOLINT, false-positive due to second-order macros. 11917 } // NOLINT, false-positive due to second-order macros.
11919 } // NOLINT, false-positive due to second-order macros. 11918 } // NOLINT, false-positive due to second-order macros.
11920 11919
11921 #endif // V8_OBJECTS_H_ 11920 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698