Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index dba816d61810d63259412f946f219494c2e134ef..613df5368f4b56352c4e4f48152c4ef24126fd3e 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -37,6 +37,14 @@ void BytecodeArrayBuilder::set_parameter_count(int number_of_parameters) { |
int BytecodeArrayBuilder::parameter_count() const { return parameter_count_; } |
+bool BytecodeArrayBuilder::HasExplicitReturn() { |
+ // TODO(rmcilroy): When we have control flow we should return false here if |
+ // there is an outstanding jump target, even if the last bytecode is kReturn. |
+ return !bytecodes_.empty() && |
+ bytecodes_.back() == Bytecodes::ToByte(Bytecode::kReturn); |
+} |
+ |
+ |
Register BytecodeArrayBuilder::Parameter(int parameter_index) { |
DCHECK_GE(parameter_index, 0); |
DCHECK_LT(parameter_index, parameter_count_); |
@@ -146,7 +154,7 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreAccumulatorInRegister( |
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( |
Register object, int feedback_slot, LanguageMode language_mode) { |
- if (is_strong(language_mode)) { |
+ if (!is_sloppy(language_mode)) { |
UNIMPLEMENTED(); |
} |
@@ -162,7 +170,7 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( |
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadKeyedProperty( |
Register object, int feedback_slot, LanguageMode language_mode) { |
- if (is_strong(language_mode)) { |
+ if (!is_sloppy(language_mode)) { |
UNIMPLEMENTED(); |
} |
@@ -176,6 +184,40 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadKeyedProperty( |
} |
+BytecodeArrayBuilder& BytecodeArrayBuilder::StoreNamedProperty( |
+ Register object, Register name, int feedback_slot, |
+ LanguageMode language_mode) { |
+ if (!is_sloppy(language_mode)) { |
+ UNIMPLEMENTED(); |
+ } |
+ |
+ if (FitsInByteOperand(feedback_slot)) { |
+ Output(Bytecode::kStoreIC, object.ToOperand(), name.ToOperand(), |
+ static_cast<uint8_t>(feedback_slot)); |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
+ return *this; |
+} |
+ |
+ |
+BytecodeArrayBuilder& BytecodeArrayBuilder::StoreKeyedProperty( |
+ Register object, Register key, int feedback_slot, |
+ LanguageMode language_mode) { |
+ if (!is_sloppy(language_mode)) { |
+ UNIMPLEMENTED(); |
+ } |
+ |
+ if (FitsInByteOperand(feedback_slot)) { |
+ Output(Bytecode::kKeyedStoreIC, object.ToOperand(), key.ToOperand(), |
+ static_cast<uint8_t>(feedback_slot)); |
+ } else { |
+ UNIMPLEMENTED(); |
+ } |
+ return *this; |
+} |
+ |
+ |
BytecodeArrayBuilder& BytecodeArrayBuilder::Return() { |
Output(Bytecode::kReturn); |
return *this; |