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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 61893009: Add initial hydrogenized NewStringAddStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case for --new-string-add. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after
4070 if (!access.IsInobject()) { 4070 if (!access.IsInobject()) {
4071 write_register = ToRegister(instr->temp()); 4071 write_register = ToRegister(instr->temp());
4072 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 4072 __ movq(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
4073 } 4073 }
4074 4074
4075 if (instr->value()->IsConstantOperand()) { 4075 if (instr->value()->IsConstantOperand()) {
4076 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 4076 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4077 if (operand_value->IsRegister()) { 4077 if (operand_value->IsRegister()) {
4078 Register value = ToRegister(operand_value); 4078 Register value = ToRegister(operand_value);
4079 __ Store(FieldOperand(write_register, offset), value, representation); 4079 __ Store(FieldOperand(write_register, offset), value, representation);
4080 } else if (representation.IsInteger32()) {
4081 int32_t value = ToInteger32(operand_value);
4082 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4083 __ movl(FieldOperand(write_register, offset), Immediate(value));
4080 } else { 4084 } else {
4081 Handle<Object> handle_value = ToHandle(operand_value); 4085 Handle<Object> handle_value = ToHandle(operand_value);
4082 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 4086 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4083 __ Move(FieldOperand(write_register, offset), handle_value); 4087 __ Move(FieldOperand(write_register, offset), handle_value);
4084 } 4088 }
4085 } else { 4089 } else {
4086 Register value = ToRegister(instr->value()); 4090 Register value = ToRegister(instr->value());
4087 __ Store(FieldOperand(write_register, offset), value, representation); 4091 __ Store(FieldOperand(write_register, offset), value, representation);
4088 } 4092 }
4089 4093
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
4393 Register temp = ToRegister(instr->temp()); 4397 Register temp = ToRegister(instr->temp());
4394 Label no_memento_found; 4398 Label no_memento_found;
4395 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found); 4399 __ TestJSArrayForAllocationMemento(object, temp, &no_memento_found);
4396 DeoptimizeIf(equal, instr->environment()); 4400 DeoptimizeIf(equal, instr->environment());
4397 __ bind(&no_memento_found); 4401 __ bind(&no_memento_found);
4398 } 4402 }
4399 4403
4400 4404
4401 void LCodeGen::DoStringAdd(LStringAdd* instr) { 4405 void LCodeGen::DoStringAdd(LStringAdd* instr) {
4402 ASSERT(ToRegister(instr->context()).is(rsi)); 4406 ASSERT(ToRegister(instr->context()).is(rsi));
4403 EmitPushTaggedOperand(instr->left()); 4407 if (FLAG_new_string_add) {
4404 EmitPushTaggedOperand(instr->right()); 4408 ASSERT(ToRegister(instr->left()).is(rdx));
4405 StringAddStub stub(instr->hydrogen()->flags()); 4409 ASSERT(ToRegister(instr->right()).is(rax));
4406 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 4410 NewStringAddStub stub(instr->hydrogen()->flags(),
4411 isolate()->heap()->GetPretenureMode());
4412 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4413 } else {
4414 EmitPushTaggedOperand(instr->left());
4415 EmitPushTaggedOperand(instr->right());
4416 StringAddStub stub(instr->hydrogen()->flags());
4417 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
4418 }
4407 } 4419 }
4408 4420
4409 4421
4410 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) { 4422 void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
4411 class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode { 4423 class DeferredStringCharCodeAt V8_FINAL : public LDeferredCode {
4412 public: 4424 public:
4413 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr) 4425 DeferredStringCharCodeAt(LCodeGen* codegen, LStringCharCodeAt* instr)
4414 : LDeferredCode(codegen), instr_(instr) { } 4426 : LDeferredCode(codegen), instr_(instr) { }
4415 virtual void Generate() V8_OVERRIDE { 4427 virtual void Generate() V8_OVERRIDE {
4416 codegen()->DoDeferredStringCharCodeAt(instr_); 4428 codegen()->DoDeferredStringCharCodeAt(instr_);
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
5634 FixedArray::kHeaderSize - kPointerSize)); 5646 FixedArray::kHeaderSize - kPointerSize));
5635 __ bind(&done); 5647 __ bind(&done);
5636 } 5648 }
5637 5649
5638 5650
5639 #undef __ 5651 #undef __
5640 5652
5641 } } // namespace v8::internal 5653 } } // namespace v8::internal
5642 5654
5643 #endif // V8_TARGET_ARCH_X64 5655 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698