Reviewers: Vyacheslav Egorov,

Description:
Remove unnecessary environment from LStoreKeyedFastElements.

This was a left-over from a time when bounds-check was performed
as part of this instruction.

[email protected]

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

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

Affected files:
  M     src/arm/lithium-arm.cc
  M     src/ia32/lithium-ia32.cc
  M     src/mips/lithium-mips.cc
  M     src/x64/lithium-x64.cc


Index: src/arm/lithium-arm.cc
===================================================================
--- src/arm/lithium-arm.cc      (revision 10299)
+++ src/arm/lithium-arm.cc      (working copy)
@@ -1938,8 +1938,9 @@
   LOperand* key = needs_write_barrier
       ? UseTempRegister(instr->key())
       : UseRegisterOrConstantAtStart(instr->key());
-
-  return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
+  LInstruction* result = new LStoreKeyedFastElement(obj, key, val);
+  if (instr->ValueNeedsSmiCheck()) AssignEnvironment(result);
+  return result;
 }


Index: src/ia32/lithium-ia32.cc
===================================================================
--- src/ia32/lithium-ia32.cc    (revision 10299)
+++ src/ia32/lithium-ia32.cc    (working copy)
@@ -2024,7 +2024,9 @@
       ? UseTempRegister(instr->key())
       : UseRegisterOrConstantAtStart(instr->key());

- return AssignEnvironment(new(zone()) LStoreKeyedFastElement(obj, key, val));
+  LInstruction* result = new(zone()) LStoreKeyedFastElement(obj, key, val);
+  if (instr->ValueNeedsSmiCheck()) AssignEnvironment(result);
+  return result;
 }


Index: src/mips/lithium-mips.cc
===================================================================
--- src/mips/lithium-mips.cc    (revision 10299)
+++ src/mips/lithium-mips.cc    (working copy)
@@ -1941,8 +1941,9 @@
   LOperand* key = needs_write_barrier
       ? UseTempRegister(instr->key())
       : UseRegisterOrConstantAtStart(instr->key());
-
-  return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
+  LInstruction* result = new LStoreKeyedFastElement(obj, key, val);
+  if (instr->ValueNeedsSmiCheck()) AssignEnvironment(result);
+  return result;
 }


Index: src/x64/lithium-x64.cc
===================================================================
--- src/x64/lithium-x64.cc      (revision 10299)
+++ src/x64/lithium-x64.cc      (working copy)
@@ -1929,8 +1929,9 @@
   LOperand* key = needs_write_barrier
       ? UseTempRegister(instr->key())
       : UseRegisterOrConstantAtStart(instr->key());
-
-  return AssignEnvironment(new LStoreKeyedFastElement(obj, key, val));
+  LInstruction* result = new LStoreKeyedFastElement(obj, key, val);
+  if (instr->ValueNeedsSmiCheck()) AssignEnvironment(result);
+  return result;
 }




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

Reply via email to