OLD | NEW |
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 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 // CreateObjectLiteral <idx> <flags> | 1362 // CreateObjectLiteral <idx> <flags> |
1363 // | 1363 // |
1364 // Creates an object literal for literal index <idx> with flags <flags> and | 1364 // Creates an object literal for literal index <idx> with flags <flags> and |
1365 // constant elements in the accumulator. | 1365 // constant elements in the accumulator. |
1366 void Interpreter::DoCreateObjectLiteral( | 1366 void Interpreter::DoCreateObjectLiteral( |
1367 compiler::InterpreterAssembler* assembler) { | 1367 compiler::InterpreterAssembler* assembler) { |
1368 DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler); | 1368 DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler); |
1369 } | 1369 } |
1370 | 1370 |
1371 | 1371 |
1372 // CreateClosure <tenured> | 1372 // CreateClosure <index> <tenured> |
1373 // | 1373 // |
1374 // Creates a new closure for SharedFunctionInfo in the accumulator with the | 1374 // Creates a new closure for SharedFunctionInfo at position |index| in the |
1375 // PretenureFlag <tenured>. | 1375 // constant pool and with the PretenureFlag <tenured>. |
1376 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) { | 1376 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) { |
1377 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of | 1377 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of |
1378 // calling into the runtime. | 1378 // calling into the runtime. |
1379 Node* shared = __ GetAccumulator(); | 1379 Node* index = __ BytecodeOperandIdx(0); |
1380 Node* tenured_raw = __ BytecodeOperandImm(0); | 1380 Node* shared = __ LoadConstantPoolEntry(index); |
| 1381 Node* tenured_raw = __ BytecodeOperandImm(1); |
1381 Node* tenured = __ SmiTag(tenured_raw); | 1382 Node* tenured = __ SmiTag(tenured_raw); |
1382 Node* result = | 1383 Node* result = |
1383 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); | 1384 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); |
1384 __ SetAccumulator(result); | 1385 __ SetAccumulator(result); |
1385 __ Dispatch(); | 1386 __ Dispatch(); |
1386 } | 1387 } |
1387 | 1388 |
1388 | 1389 |
| 1390 // CreateClosureWide <index> <tenured> |
| 1391 // |
| 1392 // Creates a new closure for SharedFunctionInfo at position |index| in the |
| 1393 // constant pool and with the PretenureFlag <tenured>. |
| 1394 void Interpreter::DoCreateClosureWide( |
| 1395 compiler::InterpreterAssembler* assembler) { |
| 1396 return DoCreateClosure(assembler); |
| 1397 } |
| 1398 |
| 1399 |
1389 // CreateMappedArguments | 1400 // CreateMappedArguments |
1390 // | 1401 // |
1391 // Creates a new mapped arguments object. | 1402 // Creates a new mapped arguments object. |
1392 void Interpreter::DoCreateMappedArguments( | 1403 void Interpreter::DoCreateMappedArguments( |
1393 compiler::InterpreterAssembler* assembler) { | 1404 compiler::InterpreterAssembler* assembler) { |
1394 Node* closure = __ LoadRegister(Register::function_closure()); | 1405 Node* closure = __ LoadRegister(Register::function_closure()); |
1395 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure); | 1406 Node* result = __ CallRuntime(Runtime::kNewSloppyArguments_Generic, closure); |
1396 __ SetAccumulator(result); | 1407 __ SetAccumulator(result); |
1397 __ Dispatch(); | 1408 __ Dispatch(); |
1398 } | 1409 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); | 1487 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); |
1477 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); | 1488 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); |
1478 __ SetAccumulator(result); | 1489 __ SetAccumulator(result); |
1479 __ Dispatch(); | 1490 __ Dispatch(); |
1480 } | 1491 } |
1481 | 1492 |
1482 | 1493 |
1483 } // namespace interpreter | 1494 } // namespace interpreter |
1484 } // namespace internal | 1495 } // namespace internal |
1485 } // namespace v8 | 1496 } // namespace v8 |
OLD | NEW |