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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 2930933002: [turbofan] JSCreateClosure doesn't have any JS observable side effects. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-generic-lowering.h" 5 #include "src/compiler/js-generic-lowering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 node->InsertInput(zone(), 2 + arity, type_info); 391 node->InsertInput(zone(), 2 + arity, type_info);
392 ReplaceWithRuntimeCall(node, Runtime::kNewArray, arity + 3); 392 ReplaceWithRuntimeCall(node, Runtime::kNewArray, arity + 3);
393 } 393 }
394 394
395 395
396 void JSGenericLowering::LowerJSCreateClosure(Node* node) { 396 void JSGenericLowering::LowerJSCreateClosure(Node* node) {
397 CreateClosureParameters const& p = CreateClosureParametersOf(node->op()); 397 CreateClosureParameters const& p = CreateClosureParametersOf(node->op());
398 CallDescriptor::Flags flags = FrameStateFlagForCall(node); 398 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
399 Handle<SharedFunctionInfo> const shared_info = p.shared_info(); 399 Handle<SharedFunctionInfo> const shared_info = p.shared_info();
400 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info)); 400 node->InsertInput(zone(), 0, jsgraph()->HeapConstant(shared_info));
401 node->RemoveInput(3); // control
401 402
402 // Use the FastNewClosurebuiltin only for functions allocated in new 403 // Use the FastNewClosure builtin only for functions allocated in new space.
403 // space.
404 if (p.pretenure() == NOT_TENURED) { 404 if (p.pretenure() == NOT_TENURED) {
405 Callable callable = CodeFactory::FastNewClosure(isolate()); 405 Callable callable = CodeFactory::FastNewClosure(isolate());
406 node->InsertInput(zone(), 1, 406 node->InsertInput(zone(), 1,
407 jsgraph()->HeapConstant(p.feedback().vector())); 407 jsgraph()->HeapConstant(p.feedback().vector()));
408 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); 408 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
409 ReplaceWithStubCall(node, callable, flags); 409 ReplaceWithStubCall(node, callable, flags);
410 } else { 410 } else {
411 node->InsertInput(zone(), 1, 411 node->InsertInput(zone(), 1,
412 jsgraph()->HeapConstant(p.feedback().vector())); 412 jsgraph()->HeapConstant(p.feedback().vector()));
413 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); 413 node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index()));
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 766 }
767 767
768 768
769 MachineOperatorBuilder* JSGenericLowering::machine() const { 769 MachineOperatorBuilder* JSGenericLowering::machine() const {
770 return jsgraph()->machine(); 770 return jsgraph()->machine();
771 } 771 }
772 772
773 } // namespace compiler 773 } // namespace compiler
774 } // namespace internal 774 } // namespace internal
775 } // namespace v8 775 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698