Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index e8e95025ec22e8a48b126411832ef94346691119..9dfa90f346e9820490af1678220f20ed7f8b73db 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -5404,11 +5404,37 @@ class Code: public HeapObject { |
class AbstractCode : public HeapObject { |
public: |
+ // All code kinds and INTERPRETED_FUNCTION. |
+ enum Kind { |
+#define DEFINE_CODE_KIND_ENUM(name) name, |
+ CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) |
+#undef DEFINE_CODE_KIND_ENUM |
+ INTERPRETED_FUNCTION, |
+ }; |
+ |
int SourcePosition(int offset); |
int SourceStatementPosition(int offset); |
+ // Returns the address of the first instruction. |
+ inline Address instruction_start(); |
+ |
+ // Returns the address right after the last instruction. |
+ inline Address instruction_end(); |
+ |
+ // Returns the of the code instructions. |
+ inline int instruction_size(); |
+ |
+ // Returns true if pc is inside this object's instructions. |
+ inline bool contains(byte* pc); |
+ |
+ // Returns the AbstractCode::Kind of the code. |
+ inline Kind kind(); |
+ |
+ // Calculate the size of the code object to report for log events. This takes |
+ // the layout of the code object into account. |
+ inline int ExecutableSize(); |
+ |
DECLARE_CAST(AbstractCode) |
- inline int Size(); |
inline Code* GetCode(); |
inline BytecodeArray* GetBytecodeArray(); |
}; |
@@ -6606,6 +6632,10 @@ class SharedFunctionInfo: public HeapObject { |
// [code]: Function code. |
DECL_ACCESSORS(code, Code) |
+ // Get the abstract code associated with the function, which will either be |
+ // a Code object or a BytecodeArray. |
+ inline AbstractCode* abstract_code(); |
+ |
inline void ReplaceCode(Code* code); |
// [optimized_code_map]: Map from native context to optimized code |
@@ -7442,6 +7472,10 @@ class JSFunction: public JSObject { |
inline void set_code_no_write_barrier(Code* code); |
inline void ReplaceCode(Code* code); |
+ // Get the abstract code associated with the function, which will either be |
+ // a Code object or a BytecodeArray. |
+ inline AbstractCode* abstract_code(); |
+ |
// Tells whether this function inlines the given shared function info. |
bool Inlines(SharedFunctionInfo* candidate); |