Revision: 6247
Author: [email protected]
Date: Mon Jan 10 04:24:19 2011
Log: 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.

Review URL: http://codereview.chromium.org/6119004
http://code.google.com/p/v8/source/detail?r=6247

Modified:
 /branches/bleeding_edge/src/arm/lithium-arm.cc
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
 /branches/bleeding_edge/src/arm/macro-assembler-arm.cc
 /branches/bleeding_edge/src/arm/macro-assembler-arm.h

=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc      Mon Jan 10 03:31:21 2011
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc      Mon Jan 10 04:24:19 2011
@@ -1803,8 +1803,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);
 }

=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Jan 10 00:04:30 2011 +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Jan 10 04:24:19 2011
@@ -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);
 }


=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Jan 10 00:04:30 2011 +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Jan 10 04:24:19 2011
@@ -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);
=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.h Mon Jan 10 00:04:30 2011 +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.h Mon Jan 10 04:24:19 2011
@@ -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