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

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

Issue 1469303006: Revert of 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 <index> <tenured> 1370 // CreateClosure <tenured>
1371 // 1371 //
1372 // Creates a new closure for SharedFunctionInfo at position |index| in the 1372 // Creates a new closure for SharedFunctionInfo in the accumulator with the
1373 // constant pool and with the PretenureFlag <tenured>. 1373 // 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* index = __ BytecodeOperandIdx(0); 1377 Node* shared = __ GetAccumulator();
1378 Node* shared = __ LoadConstantPoolEntry(index); 1378 Node* tenured_raw = __ BytecodeOperandImm(0);
1379 Node* tenured_raw = __ BytecodeOperandImm(1);
1380 Node* tenured = __ SmiTag(tenured_raw); 1379 Node* tenured = __ SmiTag(tenured_raw);
1381 Node* result = 1380 Node* result =
1382 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); 1381 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured);
1383 __ SetAccumulator(result); 1382 __ SetAccumulator(result);
1384 __ Dispatch(); 1383 __ Dispatch();
1385 } 1384 }
1386 1385
1387 1386
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
1398 // CreateMappedArguments 1387 // CreateMappedArguments
1399 // 1388 //
1400 // Creates a new mapped arguments object. 1389 // Creates a new mapped arguments object.
1401 void Interpreter::DoCreateMappedArguments( 1390 void Interpreter::DoCreateMappedArguments(
1402 compiler::InterpreterAssembler* assembler) { 1391 compiler::InterpreterAssembler* assembler) {
1403 Node* closure = __ LoadRegister(Register::function_closure()); 1392 Node* closure = __ LoadRegister(Register::function_closure());
1404 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure); 1393 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure);
1405 __ SetAccumulator(result); 1394 __ SetAccumulator(result);
1406 __ Dispatch(); 1395 __ Dispatch();
1407 } 1396 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); 1474 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3);
1486 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); 1475 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length);
1487 __ SetAccumulator(result); 1476 __ SetAccumulator(result);
1488 __ Dispatch(); 1477 __ Dispatch();
1489 } 1478 }
1490 1479
1491 1480
1492 } // namespace interpreter 1481 } // namespace interpreter
1493 } // namespace internal 1482 } // namespace internal
1494 } // namespace v8 1483 } // 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