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

Unified Diff: src/ia32/lithium-ia32.cc

Issue 57383004: Improve implementation of HSeqStringSetChar. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Increase GVNFlags to 64bit. Add StringChars flag. Created 7 years, 1 month 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/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index fdddef3f479a6eb3af46d21f3b98bb9e2d8877c0..3390aa6127275e35a96ed90452b6688f1331840f 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -580,6 +580,14 @@ LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) {
}
+LOperand* LChunkBuilder::UseFixedOrConstant(HValue* value,
+ Register fixed_register) {
+ return CanBeImmediateConstant(value)
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : UseFixed(value, fixed_register);
+}
+
+
LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) {
return CanBeImmediateConstant(value)
? chunk_->DefineConstantOperand(HConstant::cast(value))
@@ -1866,13 +1874,12 @@ LInstruction* LChunkBuilder::DoDateField(HDateField* instr) {
LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
- LOperand* string = UseRegister(instr->string());
- LOperand* index = UseRegister(instr->index());
- ASSERT(ecx.is_byte_register());
- LOperand* value = UseFixed(instr->value(), ecx);
- LSeqStringSetChar* result =
- new(zone()) LSeqStringSetChar(instr->encoding(), string, index, value);
- return DefineSameAsFirst(result);
+ LOperand* string = UseRegisterAtStart(instr->string());
+ LOperand* index = UseRegisterOrConstantAtStart(instr->index());
+ LOperand* value = (instr->encoding() == String::ONE_BYTE_ENCODING)
+ ? UseFixedOrConstant(instr->value(), eax)
Yang 2013/11/06 09:55:09 Why does this have to be fixed to eax, why not Use
Benedikt Meurer 2013/11/06 10:06:36 Because mov_b() requires a byte register.
+ : UseRegisterOrConstantAtStart(instr->value());
+ return new(zone()) LSeqStringSetChar(string, index, value);
}
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/assembler-x64.h » ('j') | test/mjsunit/string-natives.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698