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

Unified Diff: src/liveedit.cc

Issue 1145893003: [crankshaft] Record inlined shared function infos instead of closures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 5 years, 7 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/lithium.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/liveedit.cc
diff --git a/src/liveedit.cc b/src/liveedit.cc
index c03d8d3e938f98da66c56d484e88d88ef97ce2ad..41aa83d9801ea5ec502c1c01636f09a607811a08 100644
--- a/src/liveedit.cc
+++ b/src/liveedit.cc
@@ -1089,37 +1089,36 @@ class LiteralFixer {
};
+namespace {
+
// Check whether the code is natural function code (not a lazy-compile stub
// code).
-static bool IsJSFunctionCode(Code* code) {
- return code->kind() == Code::FUNCTION;
-}
+bool IsJSFunctionCode(Code* code) { return code->kind() == Code::FUNCTION; }
// Returns true if an instance of candidate were inlined into function's code.
-static bool IsInlined(JSFunction* function, SharedFunctionInfo* candidate) {
+bool IsInlined(JSFunction* function, SharedFunctionInfo* candidate) {
DisallowHeapAllocation no_gc;
if (function->code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
- DeoptimizationInputData* data =
+ DeoptimizationInputData* const data =
DeoptimizationInputData::cast(function->code()->deoptimization_data());
-
- if (data == function->GetIsolate()->heap()->empty_fixed_array()) {
- return false;
- }
-
- FixedArray* literals = data->LiteralArray();
-
- int inlined_count = data->InlinedFunctionCount()->value();
- for (int i = 0; i < inlined_count; ++i) {
- JSFunction* inlined = JSFunction::cast(literals->get(i));
- if (inlined->shared() == candidate) return true;
+ if (data != function->GetIsolate()->heap()->empty_fixed_array()) {
+ 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;
}
+} // namespace
+
// Marks code that shares the same shared function info or has inlined
// code that shares the same function info.
« no previous file with comments | « src/lithium.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698