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

Unified Diff: src/compiler/interpreter-assembler.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/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index ca6c6134ed26f840742982aa633ecfce58befafc..d8f7990b3b2075b806712eb759149bcc07c419a5 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -274,14 +274,11 @@ Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) {
}
-Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) {
- return raw_assembler_->Load(kMachAnyTagged, context,
- IntPtrConstant(Context::SlotOffset(slot_index)));
-}
-
-
-Node* InterpreterAssembler::LoadContextSlot(int slot_index) {
- return LoadContextSlot(ContextTaggedPointer(), slot_index);
+Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) {
+ Node* offset =
+ IntPtrAdd(WordShl(slot_index, kPointerSizeLog2),
+ Int32Constant(Context::kHeaderSize - kHeapObjectTag));
+ return raw_assembler_->Load(kMachAnyTagged, context, offset);
}

Powered by Google App Engine
This is Rietveld 408576698