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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1906823002: Move of the type feedback vector to the closure. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 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/compiler/js-create-lowering.cc ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 63b3e3941d77cdff21c0977f229e6a8282446bb1..7ccbacb749c9f083db6662b80240c9666d70e51e 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -159,14 +159,13 @@ void JSGenericLowering::LowerJSLoadProperty(Node* node) {
Callable callable =
CodeFactory::KeyedLoadICInOptimizedCode(isolate(), UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
@@ -185,14 +184,13 @@ void JSGenericLowering::LowerJSLoadNamed(Node* node) {
Callable callable = CodeFactory::LoadICInOptimizedCode(
isolate(), NOT_INSIDE_TYPEOF, UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
@@ -213,14 +211,13 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
Callable callable = CodeFactory::LoadICInOptimizedCode(
isolate(), p.typeof_mode(), UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
// Load global object from the context.
@@ -252,14 +249,13 @@ void JSGenericLowering::LowerJSStoreProperty(Node* node) {
Callable callable = CodeFactory::KeyedStoreICInOptimizedCode(
isolate(), language_mode, UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
node->InsertInput(zone(), 3, jsgraph()->SmiConstant(p.feedback().index()));
@@ -278,14 +274,13 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) {
Callable callable = CodeFactory::StoreICInOptimizedCode(
isolate(), p.language_mode(), UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name()));
@@ -306,14 +301,13 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
Callable callable = CodeFactory::StoreICInOptimizedCode(
isolate(), p.language_mode(), UNINITIALIZED);
// Load the type feedback vector from the closure.
- Node* shared_info = effect = graph()->NewNode(
+ Node* literals = effect = graph()->NewNode(
machine()->Load(MachineType::AnyTagged()), closure,
- jsgraph()->IntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
- kHeapObjectTag),
+ jsgraph()->IntPtrConstant(JSFunction::kLiteralsOffset - kHeapObjectTag),
effect, control);
Node* vector = effect = graph()->NewNode(
- machine()->Load(MachineType::AnyTagged()), shared_info,
- jsgraph()->IntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
+ machine()->Load(MachineType::AnyTagged()), literals,
+ jsgraph()->IntPtrConstant(LiteralsArray::kFeedbackVectorOffset -
kHeapObjectTag),
effect, control);
// Load global object from the context.
@@ -486,9 +480,8 @@ void JSGenericLowering::LowerJSCreateClosure(Node* node) {
Handle<SharedFunctionInfo> const shared_info = p.shared_info();
node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info));
- // Use the FastNewClosureStub that allocates in new space only for nested
- // functions that don't need literals cloning.
- if (p.pretenure() == NOT_TENURED && shared_info->num_literals() == 0) {
+ // Use the FastNewClosureStub only for functions allocated in new space.
+ if (p.pretenure() == NOT_TENURED) {
Callable callable = CodeFactory::FastNewClosure(
isolate(), shared_info->language_mode(), shared_info->kind());
ReplaceWithStubCall(node, callable, flags);
« no previous file with comments | « src/compiler/js-create-lowering.cc ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698