| 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 <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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); | 403 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
| 404 return __ CallStub(ic.descriptor(), code_target, context, global, name, | 404 return __ CallStub(ic.descriptor(), code_target, context, global, name, |
| 405 smi_slot, type_feedback_vector); | 405 smi_slot, type_feedback_vector); |
| 406 } | 406 } |
| 407 | 407 |
| 408 // LdaGlobal <name_index> <slot> | 408 // LdaGlobal <name_index> <slot> |
| 409 // | 409 // |
| 410 // Load the global with name in constant pool entry <name_index> into the | 410 // Load the global with name in constant pool entry <name_index> into the |
| 411 // accumulator using FeedBackVector slot <slot> outside of a typeof. | 411 // accumulator using FeedBackVector slot <slot> outside of a typeof. |
| 412 void Interpreter::DoLdaGlobal(InterpreterAssembler* assembler) { | 412 void Interpreter::DoLdaGlobal(InterpreterAssembler* assembler) { |
| 413 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); | 413 Callable ic = |
| 414 CodeFactory::LoadGlobalICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); |
| 414 Node* result = BuildLoadGlobal(ic, assembler); | 415 Node* result = BuildLoadGlobal(ic, assembler); |
| 415 __ SetAccumulator(result); | 416 __ SetAccumulator(result); |
| 416 __ Dispatch(); | 417 __ Dispatch(); |
| 417 } | 418 } |
| 418 | 419 |
| 419 // LdrGlobal <name_index> <slot> <reg> | 420 // LdrGlobal <name_index> <slot> <reg> |
| 420 // | 421 // |
| 421 // Load the global with name in constant pool entry <name_index> into | 422 // Load the global with name in constant pool entry <name_index> into |
| 422 // register <reg> using FeedBackVector slot <slot> outside of a typeof. | 423 // register <reg> using FeedBackVector slot <slot> outside of a typeof. |
| 423 void Interpreter::DoLdrGlobal(InterpreterAssembler* assembler) { | 424 void Interpreter::DoLdrGlobal(InterpreterAssembler* assembler) { |
| 424 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); | 425 Callable ic = |
| 426 CodeFactory::LoadGlobalICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); |
| 425 Node* result = BuildLoadGlobal(ic, assembler); | 427 Node* result = BuildLoadGlobal(ic, assembler); |
| 426 Node* destination = __ BytecodeOperandReg(2); | 428 Node* destination = __ BytecodeOperandReg(2); |
| 427 __ StoreRegister(result, destination); | 429 __ StoreRegister(result, destination); |
| 428 __ Dispatch(); | 430 __ Dispatch(); |
| 429 } | 431 } |
| 430 | 432 |
| 431 // LdaGlobalInsideTypeof <name_index> <slot> | 433 // LdaGlobalInsideTypeof <name_index> <slot> |
| 432 // | 434 // |
| 433 // Load the global with name in constant pool entry <name_index> into the | 435 // Load the global with name in constant pool entry <name_index> into the |
| 434 // accumulator using FeedBackVector slot <slot> inside of a typeof. | 436 // accumulator using FeedBackVector slot <slot> inside of a typeof. |
| 435 void Interpreter::DoLdaGlobalInsideTypeof(InterpreterAssembler* assembler) { | 437 void Interpreter::DoLdaGlobalInsideTypeof(InterpreterAssembler* assembler) { |
| 436 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF); | 438 Callable ic = |
| 439 CodeFactory::LoadGlobalICInOptimizedCode(isolate_, INSIDE_TYPEOF); |
| 437 Node* result = BuildLoadGlobal(ic, assembler); | 440 Node* result = BuildLoadGlobal(ic, assembler); |
| 438 __ SetAccumulator(result); | 441 __ SetAccumulator(result); |
| 439 __ Dispatch(); | 442 __ Dispatch(); |
| 440 } | 443 } |
| 441 | 444 |
| 442 void Interpreter::DoStaGlobal(Callable ic, InterpreterAssembler* assembler) { | 445 void Interpreter::DoStaGlobal(Callable ic, InterpreterAssembler* assembler) { |
| 443 // Get the global object. | 446 // Get the global object. |
| 444 Node* context = __ GetContext(); | 447 Node* context = __ GetContext(); |
| 445 Node* native_context = | 448 Node* native_context = |
| 446 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX); | 449 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 Node* context = __ GetContext(); | 588 Node* context = __ GetContext(); |
| 586 return __ CallStub(ic.descriptor(), code_target, context, object, name, | 589 return __ CallStub(ic.descriptor(), code_target, context, object, name, |
| 587 smi_slot, type_feedback_vector); | 590 smi_slot, type_feedback_vector); |
| 588 } | 591 } |
| 589 | 592 |
| 590 // LdaNamedProperty <object> <name_index> <slot> | 593 // LdaNamedProperty <object> <name_index> <slot> |
| 591 // | 594 // |
| 592 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at | 595 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at |
| 593 // constant pool entry <name_index>. | 596 // constant pool entry <name_index>. |
| 594 void Interpreter::DoLdaNamedProperty(InterpreterAssembler* assembler) { | 597 void Interpreter::DoLdaNamedProperty(InterpreterAssembler* assembler) { |
| 595 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); | 598 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_); |
| 596 Node* result = BuildLoadNamedProperty(ic, assembler); | 599 Node* result = BuildLoadNamedProperty(ic, assembler); |
| 597 __ SetAccumulator(result); | 600 __ SetAccumulator(result); |
| 598 __ Dispatch(); | 601 __ Dispatch(); |
| 599 } | 602 } |
| 600 | 603 |
| 601 // LdrNamedProperty <object> <name_index> <slot> <reg> | 604 // LdrNamedProperty <object> <name_index> <slot> <reg> |
| 602 // | 605 // |
| 603 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at | 606 // Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at |
| 604 // constant pool entry <name_index> and puts the result into register <reg>. | 607 // constant pool entry <name_index> and puts the result into register <reg>. |
| 605 void Interpreter::DoLdrNamedProperty(InterpreterAssembler* assembler) { | 608 void Interpreter::DoLdrNamedProperty(InterpreterAssembler* assembler) { |
| 606 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF); | 609 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_); |
| 607 Node* result = BuildLoadNamedProperty(ic, assembler); | 610 Node* result = BuildLoadNamedProperty(ic, assembler); |
| 608 Node* destination = __ BytecodeOperandReg(3); | 611 Node* destination = __ BytecodeOperandReg(3); |
| 609 __ StoreRegister(result, destination); | 612 __ StoreRegister(result, destination); |
| 610 __ Dispatch(); | 613 __ Dispatch(); |
| 611 } | 614 } |
| 612 | 615 |
| 613 Node* Interpreter::BuildLoadKeyedProperty(Callable ic, | 616 Node* Interpreter::BuildLoadKeyedProperty(Callable ic, |
| 614 InterpreterAssembler* assembler) { | 617 InterpreterAssembler* assembler) { |
| 615 Node* code_target = __ HeapConstant(ic.code()); | 618 Node* code_target = __ HeapConstant(ic.code()); |
| 616 Node* reg_index = __ BytecodeOperandReg(0); | 619 Node* reg_index = __ BytecodeOperandReg(0); |
| (...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 1825 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
| 1823 __ SmiTag(new_state)); | 1826 __ SmiTag(new_state)); |
| 1824 __ SetAccumulator(old_state); | 1827 __ SetAccumulator(old_state); |
| 1825 | 1828 |
| 1826 __ Dispatch(); | 1829 __ Dispatch(); |
| 1827 } | 1830 } |
| 1828 | 1831 |
| 1829 } // namespace interpreter | 1832 } // namespace interpreter |
| 1830 } // namespace internal | 1833 } // namespace internal |
| 1831 } // namespace v8 | 1834 } // namespace v8 |
| OLD | NEW |