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

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

Issue 1475793003: Reland "[Interpreter] Add CreateClosure to BytecodeGraphBuilder." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/interpreter/bytecodes.h ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.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 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 "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 // CreateObjectLiteral <idx> <flags> 1360 // CreateObjectLiteral <idx> <flags>
1361 // 1361 //
1362 // Creates an object literal for literal index <idx> with flags <flags> and 1362 // Creates an object literal for literal index <idx> with flags <flags> and
1363 // constant elements in the accumulator. 1363 // constant elements in the accumulator.
1364 void Interpreter::DoCreateObjectLiteral( 1364 void Interpreter::DoCreateObjectLiteral(
1365 compiler::InterpreterAssembler* assembler) { 1365 compiler::InterpreterAssembler* assembler) {
1366 DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler); 1366 DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler);
1367 } 1367 }
1368 1368
1369 1369
1370 // CreateClosure <tenured> 1370 // CreateClosure <index> <tenured>
1371 // 1371 //
1372 // Creates a new closure for SharedFunctionInfo in the accumulator with the 1372 // Creates a new closure for SharedFunctionInfo at position |index| in the
1373 // PretenureFlag <tenured>. 1373 // constant pool and with the PretenureFlag <tenured>.
1374 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) { 1374 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) {
1375 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of 1375 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of
1376 // calling into the runtime. 1376 // calling into the runtime.
1377 Node* shared = __ GetAccumulator(); 1377 Node* index = __ BytecodeOperandIdx(0);
1378 Node* tenured_raw = __ BytecodeOperandImm(0); 1378 Node* shared = __ LoadConstantPoolEntry(index);
1379 Node* tenured_raw = __ BytecodeOperandImm(1);
1379 Node* tenured = __ SmiTag(tenured_raw); 1380 Node* tenured = __ SmiTag(tenured_raw);
1380 Node* result = 1381 Node* result =
1381 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); 1382 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured);
1382 __ SetAccumulator(result); 1383 __ SetAccumulator(result);
1383 __ Dispatch(); 1384 __ Dispatch();
1384 } 1385 }
1385 1386
1386 1387
1388 // CreateClosureWide <index> <tenured>
1389 //
1390 // Creates a new closure for SharedFunctionInfo at position |index| in the
1391 // constant pool and with the PretenureFlag <tenured>.
1392 void Interpreter::DoCreateClosureWide(
1393 compiler::InterpreterAssembler* assembler) {
1394 return DoCreateClosure(assembler);
1395 }
1396
1397
1387 // CreateMappedArguments 1398 // CreateMappedArguments
1388 // 1399 //
1389 // Creates a new mapped arguments object. 1400 // Creates a new mapped arguments object.
1390 void Interpreter::DoCreateMappedArguments( 1401 void Interpreter::DoCreateMappedArguments(
1391 compiler::InterpreterAssembler* assembler) { 1402 compiler::InterpreterAssembler* assembler) {
1392 Node* closure = __ LoadRegister(Register::function_closure()); 1403 Node* closure = __ LoadRegister(Register::function_closure());
1393 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure); 1404 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure);
1394 __ SetAccumulator(result); 1405 __ SetAccumulator(result);
1395 __ Dispatch(); 1406 __ Dispatch();
1396 } 1407 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); 1485 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3);
1475 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); 1486 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length);
1476 __ SetAccumulator(result); 1487 __ SetAccumulator(result);
1477 __ Dispatch(); 1488 __ Dispatch();
1478 } 1489 }
1479 1490
1480 1491
1481 } // namespace interpreter 1492 } // namespace interpreter
1482 } // namespace internal 1493 } // namespace internal
1483 } // namespace v8 1494 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698