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

Unified Diff: src/interpreter/bytecodes.cc

Issue 1378523005: [Interpreter] Add support for global declarations and load/store of global variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_toplevel
Patch Set: Created 5 years, 3 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
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index 18c0a43e849da0460d2f8af682f4fa9e72182002..467612325dd86f0c34e508429f83e8fbd14942ba 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -218,6 +218,8 @@ std::ostream& operator<<(std::ostream& os, const OperandType& operand_type) {
static const int kLastParamRegisterIndex =
-InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize;
+static const int kFunctionContextRegisterIndex =
+ -InterpreterFrameConstants::kContextFromRegisterPointer / kPointerSize;
// Registers occupy range 0-127 in 8-bit value leaving 128 unused values.
@@ -243,6 +245,16 @@ int Register::ToParameterIndex(int parameter_count) const {
}
+Register Register::function_context() {
+ return Register(kFunctionContextRegisterIndex);
+}
+
+
+bool Register::is_function_context() const {
+ return index() == kFunctionContextRegisterIndex;
+}
+
+
int Register::MaxParameterIndex() { return kMaxParameterIndex; }

Powered by Google App Engine
This is Rietveld 408576698