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

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: Rebase 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
« no previous file with comments | « src/objects.cc ('k') | src/profiler/cpu-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index ca5c437b919f25661480572add71582f1c29a989..751c6d39baa66b35602a254ff25ddd866d3aebc2 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5130,7 +5130,7 @@ class Code::FindAndReplacePattern {
friend class Code;
};
-int AbstractCode::Size() {
+int AbstractCode::instruction_size() {
if (IsCode()) {
return GetCode()->instruction_size();
} else {
@@ -5138,6 +5138,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() {
@@ -5629,6 +5668,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(),
@@ -6020,6 +6066,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(
« no previous file with comments | « src/objects.cc ('k') | src/profiler/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698