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

Unified Diff: src/objects-inl.h

Issue 1728593002: [Interpreter] Add support for cpu profiler logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 1abc7ebf076e9d539e290e218228db1b15ce7be0..5f3837790779f8d11f19a46b209a66f011cb00ce 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5131,7 +5131,7 @@ class Code::FindAndReplacePattern {
friend class Code;
};
-int AbstractCode::Size() {
+int AbstractCode::instruction_size() {
if (IsCode()) {
return GetCode()->instruction_size();
} else {
@@ -5139,6 +5139,45 @@ int AbstractCode::Size() {
}
}
+int AbstractCode::ExecutableSize() {
+ if (IsCode()) {
+ return GetCode()->ExecutableSize();
+ } else {
+ return GetBytecodeArray()->BytecodeArraySize();
+ }
+}
+
+Address AbstractCode::instruction_start() {
+ if (IsCode()) {
+ return GetCode()->instruction_start();
+ } else {
+ return GetBytecodeArray()->GetFirstBytecodeAddress();
+ }
+}
+
+Address AbstractCode::instruction_end() {
+ if (IsCode()) {
+ return GetCode()->instruction_end();
+ } else {
+ return GetBytecodeArray()->GetFirstBytecodeAddress() +
+ GetBytecodeArray()->length();
+ }
+}
+
+bool AbstractCode::contains(byte* inner_pointer) {
+ return (address() <= inner_pointer) && (inner_pointer <= address() + Size());
+}
+
+AbstractCode::Kind AbstractCode::kind() {
+ if (IsCode()) {
+ STATIC_ASSERT(AbstractCode::FUNCTION ==
+ static_cast<AbstractCode::Kind>(Code::FUNCTION));
+ return static_cast<AbstractCode::Kind>(GetCode()->kind());
+ } else {
+ return INTERPRETED_FUNCTION;
+ }
+}
+
Code* AbstractCode::GetCode() { return Code::cast(this); }
BytecodeArray* AbstractCode::GetBytecodeArray() {
@@ -5630,6 +5669,13 @@ BOOL_GETTER(SharedFunctionInfo,
optimization_disabled,
kOptimizationDisabled)
+AbstractCode* SharedFunctionInfo::abstract_code() {
+ if (HasBytecodeArray()) {
+ return AbstractCode::cast(bytecode_array());
+ } else {
+ return AbstractCode::cast(code());
+ }
+}
void SharedFunctionInfo::set_optimization_disabled(bool disable) {
set_compiler_hints(BooleanBit::set(compiler_hints(),
@@ -6004,6 +6050,14 @@ void Map::InobjectSlackTrackingStep() {
}
}
+AbstractCode* JSFunction::abstract_code() {
+ Code* code = this->code();
+ if (code->is_interpreter_entry_trampoline()) {
+ return AbstractCode::cast(shared()->bytecode_array());
+ } else {
+ return AbstractCode::cast(code);
+ }
+}
Code* JSFunction::code() {
return Code::cast(
« src/isolate.h ('K') | « src/objects.cc ('k') | src/profiler/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698