Reviewers: Søren Gjesse,

Description:
ARM: Implement delete operation in lithium codegen.

I'm using the post call generator for the macro assembler
InvokeBuiltin call to be consistent with the ia32 version. It only
generates one call, but using the post call generator it should be
easier to catch if we change that at some point.


Please review this at http://codereview.chromium.org/6119004/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/arm/lithium-arm.cc
  M     src/arm/lithium-codegen-arm.cc
  M     src/arm/macro-assembler-arm.h
  M     src/arm/macro-assembler-arm.cc


Index: src/arm/lithium-arm.cc
===================================================================
--- src/arm/lithium-arm.cc      (revision 6241)
+++ src/arm/lithium-arm.cc      (working copy)
@@ -1829,8 +1829,9 @@


 LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) {
-  LInstruction* result = new LDeleteProperty(Use(instr->object()),
-                                             UseOrConstant(instr->key()));
+  LOperand* object = UseRegisterAtStart(instr->object());
+  LOperand* key = UseRegisterAtStart(instr->key());
+  LInstruction* result = new LDeleteProperty(object, key);
   return MarkAsCall(DefineFixed(result, r0), instr);
 }

Index: src/arm/lithium-codegen-arm.cc
===================================================================
--- src/arm/lithium-codegen-arm.cc      (revision 6241)
+++ src/arm/lithium-codegen-arm.cc      (working copy)
@@ -2624,7 +2624,14 @@


 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
-  Abort("DoDeleteProperty unimplemented.");
+  Register object = ToRegister(instr->object());
+  Register key = ToRegister(instr->key());
+  __ Push(object, key);
+  RecordPosition(instr->pointer_map()->position());
+  SafepointGenerator safepoint_generator(this,
+                                         instr->pointer_map(),
+ Safepoint::kNoDeoptimizationIndex);
+  __ InvokeBuiltin(Builtins::DELETE, CALL_JS, &safepoint_generator);
 }


Index: src/arm/macro-assembler-arm.cc
===================================================================
--- src/arm/macro-assembler-arm.cc      (revision 6241)
+++ src/arm/macro-assembler-arm.cc      (working copy)
@@ -1676,10 +1676,12 @@


 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
-                                   InvokeJSFlags flags) {
+                                   InvokeJSFlags flags,
+ PostCallGenerator* post_call_generator) {
   GetBuiltinEntry(r2, id);
   if (flags == CALL_JS) {
     Call(r2);
+    if (post_call_generator != NULL) post_call_generator->Generate();
   } else {
     ASSERT(flags == JUMP_JS);
     Jump(r2);
Index: src/arm/macro-assembler-arm.h
===================================================================
--- src/arm/macro-assembler-arm.h       (revision 6241)
+++ src/arm/macro-assembler-arm.h       (working copy)
@@ -33,6 +33,10 @@
 namespace v8 {
 namespace internal {

+// Forward declaration.
+class PostCallGenerator;
+
+
// ----------------------------------------------------------------------------
 // Static helper functions

@@ -637,7 +641,9 @@

   // Invoke specified builtin JavaScript function. Adds an entry to
   // the unresolved list if the name does not resolve.
-  void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags);
+  void InvokeBuiltin(Builtins::JavaScript id,
+                     InvokeJSFlags flags,
+                     PostCallGenerator* post_call_generator = NULL);

   // Store the code object for the given builtin in the target register and
   // setup the function in r1.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to