| 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);
|
|
|