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/bytecode-array-builder.cc

Issue 1524803003: [Interpreter] Add support for Load / Store to Lookup slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@init_eval_impl
Patch Set: Created 5 years 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/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 688ea0272d2e4b6e32df98598b6e70849922455b..2e376035d135d4a9889438f0a37b78ce67a62774 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -438,6 +438,34 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context,
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot(
+ const Handle<String> name, Register context, TypeofMode typeof_mode) {
+ Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
+ ? Bytecode::kLdaLookupSlotInsideTypeof
+ : Bytecode::kLdaLookupSlot;
+ size_t name_index = GetConstantPoolEntry(name);
+ if (FitsInIdx8Operand(name_index)) {
+ Output(bytecode, static_cast<uint8_t>(name_index), context.ToOperand());
+ } else {
+ UNIMPLEMENTED();
+ }
+ return *this;
+}
+
+
+BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
+ const Handle<String> name, Register context, LanguageMode language_mode) {
+ Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode);
+ size_t name_index = GetConstantPoolEntry(name);
+ if (FitsInIdx8Operand(name_index)) {
+ Output(bytecode, static_cast<uint8_t>(name_index), context.ToOperand());
+ } else {
+ UNIMPLEMENTED();
+ }
+ return *this;
+}
+
+
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
Register object, size_t name_index, int feedback_slot,
LanguageMode language_mode) {
@@ -1323,6 +1351,23 @@ Bytecode BytecodeArrayBuilder::BytecodeForStoreGlobal(
// static
+Bytecode BytecodeArrayBuilder::BytecodeForStoreLookupSlot(
+ LanguageMode language_mode) {
+ switch (language_mode) {
+ case SLOPPY:
+ return Bytecode::kStaLookupSlotSloppy;
+ case STRICT:
+ return Bytecode::kStaLookupSlotStrict;
+ case STRONG:
+ UNIMPLEMENTED();
+ default:
+ UNREACHABLE();
+ }
+ return static_cast<Bytecode>(-1);
+}
+
+
+// static
Bytecode BytecodeArrayBuilder::BytecodeForCreateArguments(
CreateArgumentsType type) {
switch (type) {

Powered by Google App Engine
This is Rietveld 408576698