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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2113613002: [Interpereter] Inline FastNewClosure into CreateClosure bytecode handler (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@int_context
Patch Set: Rebaseline bytecode expectations Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 __ SetAccumulator(result); 1485 __ SetAccumulator(result);
1486 __ Dispatch(); 1486 __ Dispatch();
1487 } 1487 }
1488 } 1488 }
1489 1489
1490 // CreateClosure <index> <tenured> 1490 // CreateClosure <index> <tenured>
1491 // 1491 //
1492 // Creates a new closure for SharedFunctionInfo at position |index| in the 1492 // Creates a new closure for SharedFunctionInfo at position |index| in the
1493 // constant pool and with the PretenureFlag <tenured>. 1493 // constant pool and with the PretenureFlag <tenured>.
1494 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { 1494 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
1495 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of
1496 // calling into the runtime.
1497 Node* index = __ BytecodeOperandIdx(0); 1495 Node* index = __ BytecodeOperandIdx(0);
1498 Node* shared = __ LoadConstantPoolEntry(index); 1496 Node* shared = __ LoadConstantPoolEntry(index);
1499 Node* tenured_raw = __ BytecodeOperandFlag(1); 1497 Node* flags = __ BytecodeOperandFlag(1);
1500 Node* tenured = __ SmiTag(tenured_raw);
1501 Node* context = __ GetContext(); 1498 Node* context = __ GetContext();
1502 Node* result = 1499
1503 __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, tenured); 1500 Label call_runtime(assembler, Label::kDeferred);
1504 __ SetAccumulator(result); 1501 Node* fast_new_closure = __ Word32And(
1502 flags, __ Int32Constant(CreateClosureFlags::FastNewClosureBit::kMask));
1503 __ GotoUnless(fast_new_closure, &call_runtime);
1504 __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context));
1505 __ Dispatch(); 1505 __ Dispatch();
1506
1507 __ Bind(&call_runtime);
1508 {
1509 STATIC_ASSERT(CreateClosureFlags::PretenuredBit::kShift == 0);
1510 Node* tenured_raw = __ Word32And(
1511 flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask));
1512 Node* tenured = __ SmiTag(tenured_raw);
1513 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context,
1514 shared, tenured);
1515 __ SetAccumulator(result);
1516 __ Dispatch();
1517 }
1506 } 1518 }
1507 1519
1508 // CreateMappedArguments 1520 // CreateMappedArguments
1509 // 1521 //
1510 // Creates a new mapped arguments object. 1522 // Creates a new mapped arguments object.
1511 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) { 1523 void Interpreter::DoCreateMappedArguments(InterpreterAssembler* assembler) {
1512 Node* closure = __ LoadRegister(Register::function_closure()); 1524 Node* closure = __ LoadRegister(Register::function_closure());
1513 Node* context = __ GetContext(); 1525 Node* context = __ GetContext();
1514 1526
1515 Label if_duplicate_parameters(assembler, Label::kDeferred); 1527 Label if_duplicate_parameters(assembler, Label::kDeferred);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1844 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 1856 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
1845 __ SmiTag(new_state)); 1857 __ SmiTag(new_state));
1846 __ SetAccumulator(old_state); 1858 __ SetAccumulator(old_state);
1847 1859
1848 __ Dispatch(); 1860 __ Dispatch();
1849 } 1861 }
1850 1862
1851 } // namespace interpreter 1863 } // namespace interpreter
1852 } // namespace internal 1864 } // namespace internal
1853 } // namespace v8 1865 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | test/cctest/interpreter/bytecode_expectations/BasicLoops.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698