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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // LdaLookupSlotInsideTypeof <name_index> | 448 // LdaLookupSlotInsideTypeof <name_index> |
449 // | 449 // |
450 // Lookup the object with the name in constant pool entry |name_index| | 450 // Lookup the object with the name in constant pool entry |name_index| |
451 // dynamically without causing a NoReferenceError. | 451 // dynamically without causing a NoReferenceError. |
452 void Interpreter::DoLdaLookupSlotInsideTypeof( | 452 void Interpreter::DoLdaLookupSlotInsideTypeof( |
453 compiler::InterpreterAssembler* assembler) { | 453 compiler::InterpreterAssembler* assembler) { |
454 DoLoadLookupSlot(Runtime::kLoadLookupSlotNoReferenceError, assembler); | 454 DoLoadLookupSlot(Runtime::kLoadLookupSlotNoReferenceError, assembler); |
455 } | 455 } |
456 | 456 |
457 | 457 |
| 458 // LdaLookupSlotWide <name_index> |
| 459 // |
| 460 // Lookup the object with the name in constant pool entry |name_index| |
| 461 // dynamically. |
| 462 void Interpreter::DoLdaLookupSlotWide( |
| 463 compiler::InterpreterAssembler* assembler) { |
| 464 DoLdaLookupSlot(assembler); |
| 465 } |
| 466 |
| 467 |
| 468 // LdaLookupSlotInsideTypeofWide <name_index> |
| 469 // |
| 470 // Lookup the object with the name in constant pool entry |name_index| |
| 471 // dynamically without causing a NoReferenceError. |
| 472 void Interpreter::DoLdaLookupSlotInsideTypeofWide( |
| 473 compiler::InterpreterAssembler* assembler) { |
| 474 DoLdaLookupSlotInsideTypeof(assembler); |
| 475 } |
| 476 |
| 477 |
458 void Interpreter::DoStoreLookupSlot(LanguageMode language_mode, | 478 void Interpreter::DoStoreLookupSlot(LanguageMode language_mode, |
459 compiler::InterpreterAssembler* assembler) { | 479 compiler::InterpreterAssembler* assembler) { |
460 Node* value = __ GetAccumulator(); | 480 Node* value = __ GetAccumulator(); |
461 Node* index = __ BytecodeOperandIdx(0); | 481 Node* index = __ BytecodeOperandIdx(0); |
462 Node* name = __ LoadConstantPoolEntry(index); | 482 Node* name = __ LoadConstantPoolEntry(index); |
463 Node* context = __ GetContext(); | 483 Node* context = __ GetContext(); |
464 Node* language_mode_node = __ NumberConstant(language_mode); | 484 Node* language_mode_node = __ NumberConstant(language_mode); |
465 Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name, | 485 Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name, |
466 language_mode_node); | 486 language_mode_node); |
467 __ SetAccumulator(result); | 487 __ SetAccumulator(result); |
(...skipping 14 matching lines...) Expand all Loading... |
482 // StaLookupSlotStrict <name_index> | 502 // StaLookupSlotStrict <name_index> |
483 // | 503 // |
484 // Store the object in accumulator to the object with the name in constant | 504 // Store the object in accumulator to the object with the name in constant |
485 // pool entry |name_index| in strict mode. | 505 // pool entry |name_index| in strict mode. |
486 void Interpreter::DoStaLookupSlotStrict( | 506 void Interpreter::DoStaLookupSlotStrict( |
487 compiler::InterpreterAssembler* assembler) { | 507 compiler::InterpreterAssembler* assembler) { |
488 DoStoreLookupSlot(LanguageMode::STRICT, assembler); | 508 DoStoreLookupSlot(LanguageMode::STRICT, assembler); |
489 } | 509 } |
490 | 510 |
491 | 511 |
| 512 // StaLookupSlotSloppyWide <name_index> |
| 513 // |
| 514 // Store the object in accumulator to the object with the name in constant |
| 515 // pool entry |name_index| in sloppy mode. |
| 516 void Interpreter::DoStaLookupSlotSloppyWide( |
| 517 compiler::InterpreterAssembler* assembler) { |
| 518 DoStaLookupSlotSloppy(assembler); |
| 519 } |
| 520 |
| 521 |
| 522 // StaLookupSlotStrictWide <name_index> |
| 523 // |
| 524 // Store the object in accumulator to the object with the name in constant |
| 525 // pool entry |name_index| in strict mode. |
| 526 void Interpreter::DoStaLookupSlotStrictWide( |
| 527 compiler::InterpreterAssembler* assembler) { |
| 528 DoStaLookupSlotStrict(assembler); |
| 529 } |
| 530 |
| 531 |
492 void Interpreter::DoLoadIC(Callable ic, | 532 void Interpreter::DoLoadIC(Callable ic, |
493 compiler::InterpreterAssembler* assembler) { | 533 compiler::InterpreterAssembler* assembler) { |
494 Node* code_target = __ HeapConstant(ic.code()); | 534 Node* code_target = __ HeapConstant(ic.code()); |
495 Node* register_index = __ BytecodeOperandReg(0); | 535 Node* register_index = __ BytecodeOperandReg(0); |
496 Node* object = __ LoadRegister(register_index); | 536 Node* object = __ LoadRegister(register_index); |
497 Node* constant_index = __ BytecodeOperandIdx(1); | 537 Node* constant_index = __ BytecodeOperandIdx(1); |
498 Node* name = __ LoadConstantPoolEntry(constant_index); | 538 Node* name = __ LoadConstantPoolEntry(constant_index); |
499 Node* raw_slot = __ BytecodeOperandIdx(2); | 539 Node* raw_slot = __ BytecodeOperandIdx(2); |
500 Node* smi_slot = __ SmiTag(raw_slot); | 540 Node* smi_slot = __ SmiTag(raw_slot); |
501 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 541 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 Node* index_reg = __ BytecodeOperandReg(0); | 1632 Node* index_reg = __ BytecodeOperandReg(0); |
1593 Node* index = __ LoadRegister(index_reg); | 1633 Node* index = __ LoadRegister(index_reg); |
1594 Node* result = __ CallRuntime(Runtime::kForInStep, index); | 1634 Node* result = __ CallRuntime(Runtime::kForInStep, index); |
1595 __ SetAccumulator(result); | 1635 __ SetAccumulator(result); |
1596 __ Dispatch(); | 1636 __ Dispatch(); |
1597 } | 1637 } |
1598 | 1638 |
1599 } // namespace interpreter | 1639 } // namespace interpreter |
1600 } // namespace internal | 1640 } // namespace internal |
1601 } // namespace v8 | 1641 } // namespace v8 |
OLD | NEW |