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

Unified Diff: src/interpreter/interpreter.cc

Issue 1410953003: [Interpreter] Adds delete operator to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added more tests for delete and addressed review comments Created 5 years, 2 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/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index f3f6be8a49a78b68b3547de3aa82cd8278d2c9c9..02a58a1284106dffdc9c4ae67a423f191195307f 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -493,6 +493,17 @@ void Interpreter::DoBinaryOp(Runtime::FunctionId function_id,
}
+void Interpreter::DoDelete(Runtime::FunctionId function_id,
+ compiler::InterpreterAssembler* assembler) {
rmcilroy 2015/10/26 14:31:07 indentation
mythria 2015/10/27 10:50:48 Done.
+ Node* reg_index = __ BytecodeOperandReg8(0);
+ Node* object = __ LoadRegister(reg_index);
+ Node* key = __ GetAccumulator();
+ Node* result = __ CallRuntime(function_id, object, key);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
rmcilroy 2015/10/26 14:31:07 nit - move this to be directly above DeletePropert
mythria 2015/10/27 10:50:48 Done.
+
+
// Add <src>
//
// Add register <src> to accumulator.
@@ -641,6 +652,26 @@ void Interpreter::DoTypeOf(compiler::InterpreterAssembler* assembler) {
}
+// DeletePropertyStrict
+//
+// Delete the property specified in the accumulator from the object
+// referenced by the register operand following strict mode semantics.
+void Interpreter::DoDeletePropertyStrict(
+ compiler::InterpreterAssembler* assembler) {
+ DoDelete(Runtime::kDeleteProperty_Strict, assembler);
+}
+
+
+// DeletePropertySloppy
+//
+// Delete the property specified in the accumulator from the object
+// referenced by the register operand following sloppy mode semantics.
+void Interpreter::DoDeletePropertySloppy(
+ compiler::InterpreterAssembler* assembler) {
+ DoDelete(Runtime::kDeleteProperty_Sloppy, assembler);
+}
+
+
// Call <callable> <receiver> <arg_count>
//
// Call a JSfunction or Callable in |callable| with the |receiver| and

Powered by Google App Engine
This is Rietveld 408576698