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

Unified Diff: src/objects.h

Issue 1728593002: [Interpreter] Add support for cpu profiler logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review feedback Created 4 years, 10 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
« src/log.cc ('K') | « src/log.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 3625c0363d358c65c665b0a2b1f344e8ce9bc473..7b999f199868aa1b2e288debd88c9659ee1ed180 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5403,11 +5403,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();
};
@@ -6605,6 +6631,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
@@ -7437,6 +7467,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);
« src/log.cc ('K') | « src/log.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698