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

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

Issue 2470253003: [ignition] Reuse code-stub-assembler's context load operations. (Closed)
Patch Set: Created 4 years, 1 month 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
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 <fstream> 7 #include <fstream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 Node* raw_slot = __ BytecodeOperandIdx(0); 490 Node* raw_slot = __ BytecodeOperandIdx(0);
491 Node* result = BuildLoadGlobal(ic, context, raw_slot, assembler); 491 Node* result = BuildLoadGlobal(ic, context, raw_slot, assembler);
492 __ SetAccumulator(result); 492 __ SetAccumulator(result);
493 __ Dispatch(); 493 __ Dispatch();
494 } 494 }
495 495
496 void Interpreter::DoStaGlobal(Callable ic, InterpreterAssembler* assembler) { 496 void Interpreter::DoStaGlobal(Callable ic, InterpreterAssembler* assembler) {
497 typedef StoreWithVectorDescriptor Descriptor; 497 typedef StoreWithVectorDescriptor Descriptor;
498 // Get the global object. 498 // Get the global object.
499 Node* context = __ GetContext(); 499 Node* context = __ GetContext();
500 Node* native_context = 500 Node* native_context = __ LoadNativeContext(context);
501 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX); 501 Node* global =
502 Node* global = __ LoadContextSlot(native_context, Context::EXTENSION_INDEX); 502 __ LoadContextElement(native_context, Context::EXTENSION_INDEX);
503 503
504 // Store the global via the StoreIC. 504 // Store the global via the StoreIC.
505 Node* code_target = __ HeapConstant(ic.code()); 505 Node* code_target = __ HeapConstant(ic.code());
506 Node* constant_index = __ BytecodeOperandIdx(0); 506 Node* constant_index = __ BytecodeOperandIdx(0);
507 Node* name = __ LoadConstantPoolEntry(constant_index); 507 Node* name = __ LoadConstantPoolEntry(constant_index);
508 Node* value = __ GetAccumulator(); 508 Node* value = __ GetAccumulator();
509 Node* raw_slot = __ BytecodeOperandIdx(1); 509 Node* raw_slot = __ BytecodeOperandIdx(1);
510 Node* smi_slot = __ SmiTag(raw_slot); 510 Node* smi_slot = __ SmiTag(raw_slot);
511 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 511 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
512 __ CallStub(ic.descriptor(), code_target, context, 512 __ CallStub(ic.descriptor(), code_target, context,
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) { 1750 void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) {
1751 Node* context_index = __ BytecodeOperandIdx(0); 1751 Node* context_index = __ BytecodeOperandIdx(0);
1752 Node* receiver_reg = __ BytecodeOperandReg(1); 1752 Node* receiver_reg = __ BytecodeOperandReg(1);
1753 Node* first_arg = __ RegisterLocation(receiver_reg); 1753 Node* first_arg = __ RegisterLocation(receiver_reg);
1754 Node* receiver_args_count = __ BytecodeOperandCount(2); 1754 Node* receiver_args_count = __ BytecodeOperandCount(2);
1755 Node* receiver_count = __ Int32Constant(1); 1755 Node* receiver_count = __ Int32Constant(1);
1756 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count); 1756 Node* args_count = __ Int32Sub(receiver_args_count, receiver_count);
1757 1757
1758 // Get the function to call from the native context. 1758 // Get the function to call from the native context.
1759 Node* context = __ GetContext(); 1759 Node* context = __ GetContext();
1760 Node* native_context = 1760 Node* native_context = __ LoadNativeContext(context);
1761 __ LoadContextSlot(context, Context::NATIVE_CONTEXT_INDEX);
1762 Node* function = __ LoadContextSlot(native_context, context_index); 1761 Node* function = __ LoadContextSlot(native_context, context_index);
1763 1762
1764 // Call the function. 1763 // Call the function.
1765 Node* result = __ CallJS(function, context, first_arg, args_count, 1764 Node* result = __ CallJS(function, context, first_arg, args_count,
1766 TailCallMode::kDisallow); 1765 TailCallMode::kDisallow);
1767 __ SetAccumulator(result); 1766 __ SetAccumulator(result);
1768 __ Dispatch(); 1767 __ Dispatch();
1769 } 1768 }
1770 1769
1771 // New <constructor> <first_arg> <arg_count> 1770 // New <constructor> <first_arg> <arg_count>
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, 2694 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset,
2696 __ SmiTag(new_state)); 2695 __ SmiTag(new_state));
2697 __ SetAccumulator(old_state); 2696 __ SetAccumulator(old_state);
2698 2697
2699 __ Dispatch(); 2698 __ Dispatch();
2700 } 2699 }
2701 2700
2702 } // namespace interpreter 2701 } // namespace interpreter
2703 } // namespace internal 2702 } // namespace internal
2704 } // namespace v8 2703 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/interpreter-assembler.h » ('j') | src/interpreter/interpreter-assembler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698