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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1403943004: [Interpreter] Add support for local context loads and stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_contextchain
Patch Set: Add back outer_ &&] Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/interpreter-assembler.cc ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 5f90f9ec7feebc921752e68eabdaa4c8c4ec1ed7..60b9765b54889d820047920f4d0bdee28baa79a2 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -30,19 +30,31 @@ class BytecodeArrayBuilder {
// Set number of parameters expected by function.
void set_parameter_count(int number_of_params);
- int parameter_count() const;
+ int parameter_count() const {
+ DCHECK_GE(parameter_count_, 0);
+ return parameter_count_;
+ }
// Set number of locals required for bytecode array.
void set_locals_count(int number_of_locals);
- int locals_count() const;
+ int locals_count() const {
+ DCHECK_GE(local_register_count_, 0);
+ return local_register_count_;
+ }
// Set number of contexts required for bytecode array.
void set_context_count(int number_of_contexts);
- int context_count() const;
+ int context_count() const {
+ DCHECK_GE(context_register_count_, 0);
+ return context_register_count_;
+ }
Register first_context_register() const;
Register last_context_register() const;
+ // Returns the number of fixed (non-temporary) registers.
+ int fixed_register_count() const { return context_count() + locals_count(); }
+
Register Parameter(int parameter_index) const;
// Constant loads to the accumulator.
@@ -61,6 +73,9 @@ class BytecodeArrayBuilder {
// Load the object at |slot_index| in |context| into the accumulator.
BytecodeArrayBuilder& LoadContextSlot(Register context, int slot_index);
+ // Stores the object in the accumulator into |slot_index| of |context|.
+ BytecodeArrayBuilder& StoreContextSlot(Register context, int slot_index);
+
// Register-accumulator transfers.
BytecodeArrayBuilder& LoadAccumulatorWithRegister(Register reg);
BytecodeArrayBuilder& StoreAccumulatorInRegister(Register reg);
« no previous file with comments | « src/compiler/interpreter-assembler.cc ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698