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

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

Issue 1319833004: [Interpreter] Add support for property store operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_implicit_ret
Patch Set: Add DCHECK 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698