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

Unified Diff: src/objects.cc

Issue 1233073005: Debugger: prepare code for debugging on a per-function basis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments. Created 5 years, 5 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.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index d0c415e6cd7df6c5a50a7e13aa8c403a119b7db0..fb02d8dbaea7271a88f623f2f8f59c3b9adc22a1 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9328,11 +9328,32 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
}
+bool JSFunction::Inlines(SharedFunctionInfo* candidate) {
+ DisallowHeapAllocation no_gc;
+ if (shared() == candidate) return true;
+ if (code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
+ DeoptimizationInputData* const data =
+ DeoptimizationInputData::cast(code()->deoptimization_data());
+ if (data->length() == 0) return false;
+ FixedArray* const literals = data->LiteralArray();
+ int const inlined_count = data->InlinedFunctionCount()->value();
+ for (int i = 0; i < inlined_count; ++i) {
+ if (SharedFunctionInfo::cast(literals->get(i)) == candidate) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
void JSFunction::MarkForOptimization() {
Isolate* isolate = GetIsolate();
+ // Do not optimize if function contains break points.
+ if (shared()->HasDebugInfo()) return;
DCHECK(!IsOptimized());
DCHECK(shared()->allows_lazy_compilation() ||
!shared()->optimization_disabled());
+ DCHECK(!shared()->HasDebugInfo());
set_code_no_write_barrier(
isolate->builtins()->builtin(Builtins::kCompileOptimized));
// No write barrier required, since the builtin is part of the root set.
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698