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

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

Issue 61623004: Add signed/unsigned 8-bit and 16-bit Representations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback and prepare to land 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/hydrogen-load-elimination.cc ('k') | src/ia32/lithium-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after
3208 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 3208 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
3209 HObjectAccess access = instr->hydrogen()->access(); 3209 HObjectAccess access = instr->hydrogen()->access();
3210 int offset = access.offset(); 3210 int offset = access.offset();
3211 3211
3212 if (access.IsExternalMemory()) { 3212 if (access.IsExternalMemory()) {
3213 Register result = ToRegister(instr->result()); 3213 Register result = ToRegister(instr->result());
3214 MemOperand operand = instr->object()->IsConstantOperand() 3214 MemOperand operand = instr->object()->IsConstantOperand()
3215 ? MemOperand::StaticVariable(ToExternalReference( 3215 ? MemOperand::StaticVariable(ToExternalReference(
3216 LConstantOperand::cast(instr->object()))) 3216 LConstantOperand::cast(instr->object())))
3217 : MemOperand(ToRegister(instr->object()), offset); 3217 : MemOperand(ToRegister(instr->object()), offset);
3218 if (access.representation().IsByte()) { 3218 __ Load(result, operand, access.representation());
3219 ASSERT(instr->hydrogen()->representation().IsInteger32());
3220 __ movzx_b(result, operand);
3221 } else {
3222 __ mov(result, operand);
3223 }
3224 return; 3219 return;
3225 } 3220 }
3226 3221
3227 Register object = ToRegister(instr->object()); 3222 Register object = ToRegister(instr->object());
3228 if (FLAG_track_double_fields && 3223 if (FLAG_track_double_fields &&
3229 instr->hydrogen()->representation().IsDouble()) { 3224 instr->hydrogen()->representation().IsDouble()) {
3230 if (CpuFeatures::IsSupported(SSE2)) { 3225 if (CpuFeatures::IsSupported(SSE2)) {
3231 CpuFeatureScope scope(masm(), SSE2); 3226 CpuFeatureScope scope(masm(), SSE2);
3232 XMMRegister result = ToDoubleRegister(instr->result()); 3227 XMMRegister result = ToDoubleRegister(instr->result());
3233 __ movsd(result, FieldOperand(object, offset)); 3228 __ movsd(result, FieldOperand(object, offset));
3234 } else { 3229 } else {
3235 X87Mov(ToX87Register(instr->result()), FieldOperand(object, offset)); 3230 X87Mov(ToX87Register(instr->result()), FieldOperand(object, offset));
3236 } 3231 }
3237 return; 3232 return;
3238 } 3233 }
3239 3234
3240 Register result = ToRegister(instr->result()); 3235 Register result = ToRegister(instr->result());
3241 if (!access.IsInobject()) { 3236 if (!access.IsInobject()) {
3242 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); 3237 __ mov(result, FieldOperand(object, JSObject::kPropertiesOffset));
3243 object = result; 3238 object = result;
3244 } 3239 }
3245 if (access.representation().IsByte()) { 3240 __ Load(result, FieldOperand(object, offset), access.representation());
3246 ASSERT(instr->hydrogen()->representation().IsInteger32());
3247 __ movzx_b(result, FieldOperand(object, offset));
3248 } else {
3249 __ mov(result, FieldOperand(object, offset));
3250 }
3251 } 3241 }
3252 3242
3253 3243
3254 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { 3244 void LCodeGen::EmitPushTaggedOperand(LOperand* operand) {
3255 ASSERT(!operand->IsDoubleRegister()); 3245 ASSERT(!operand->IsDoubleRegister());
3256 if (operand->IsConstantOperand()) { 3246 if (operand->IsConstantOperand()) {
3257 Handle<Object> object = ToHandle(LConstantOperand::cast(operand)); 3247 Handle<Object> object = ToHandle(LConstantOperand::cast(operand));
3258 AllowDeferredHandleDereference smi_check; 3248 AllowDeferredHandleDereference smi_check;
3259 if (object->IsSmi()) { 3249 if (object->IsSmi()) {
3260 __ Push(Handle<Smi>::cast(object)); 3250 __ Push(Handle<Smi>::cast(object));
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 HObjectAccess access = instr->hydrogen()->access(); 4399 HObjectAccess access = instr->hydrogen()->access();
4410 int offset = access.offset(); 4400 int offset = access.offset();
4411 4401
4412 if (access.IsExternalMemory()) { 4402 if (access.IsExternalMemory()) {
4413 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 4403 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4414 MemOperand operand = instr->object()->IsConstantOperand() 4404 MemOperand operand = instr->object()->IsConstantOperand()
4415 ? MemOperand::StaticVariable( 4405 ? MemOperand::StaticVariable(
4416 ToExternalReference(LConstantOperand::cast(instr->object()))) 4406 ToExternalReference(LConstantOperand::cast(instr->object())))
4417 : MemOperand(ToRegister(instr->object()), offset); 4407 : MemOperand(ToRegister(instr->object()), offset);
4418 if (instr->value()->IsConstantOperand()) { 4408 if (instr->value()->IsConstantOperand()) {
4419 ASSERT(!representation.IsByte());
4420 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 4409 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4421 __ mov(operand, Immediate(ToInteger32(operand_value))); 4410 __ mov(operand, Immediate(ToInteger32(operand_value)));
4422 } else { 4411 } else {
4423 Register value = ToRegister(instr->value()); 4412 Register value = ToRegister(instr->value());
4424 if (representation.IsByte()) { 4413 __ Store(value, operand, representation);
4425 __ mov_b(operand, value);
4426 } else {
4427 __ mov(operand, value);
4428 }
4429 } 4414 }
4430 return; 4415 return;
4431 } 4416 }
4432 4417
4433 Register object = ToRegister(instr->object()); 4418 Register object = ToRegister(instr->object());
4434 Handle<Map> transition = instr->transition(); 4419 Handle<Map> transition = instr->transition();
4435 4420
4436 if (FLAG_track_fields && representation.IsSmi()) { 4421 if (FLAG_track_fields && representation.IsSmi()) {
4437 if (instr->value()->IsConstantOperand()) { 4422 if (instr->value()->IsConstantOperand()) {
4438 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 4423 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
4496 if (!access.IsInobject()) { 4481 if (!access.IsInobject()) {
4497 write_register = ToRegister(instr->temp()); 4482 write_register = ToRegister(instr->temp());
4498 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); 4483 __ mov(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
4499 } 4484 }
4500 4485
4501 MemOperand operand = FieldOperand(write_register, offset); 4486 MemOperand operand = FieldOperand(write_register, offset);
4502 if (instr->value()->IsConstantOperand()) { 4487 if (instr->value()->IsConstantOperand()) {
4503 LConstantOperand* operand_value = LConstantOperand::cast(instr->value()); 4488 LConstantOperand* operand_value = LConstantOperand::cast(instr->value());
4504 if (operand_value->IsRegister()) { 4489 if (operand_value->IsRegister()) {
4505 Register value = ToRegister(operand_value); 4490 Register value = ToRegister(operand_value);
4506 if (representation.IsByte()) { 4491 __ Store(value, operand, representation);
4507 __ mov_b(operand, value);
4508 } else {
4509 __ mov(operand, value);
4510 }
4511 } else { 4492 } else {
4512 Handle<Object> handle_value = ToHandle(operand_value); 4493 Handle<Object> handle_value = ToHandle(operand_value);
4513 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); 4494 ASSERT(!instr->hydrogen()->NeedsWriteBarrier());
4514 __ mov(operand, handle_value); 4495 __ mov(operand, handle_value);
4515 } 4496 }
4516 } else { 4497 } else {
4517 Register value = ToRegister(instr->value()); 4498 Register value = ToRegister(instr->value());
4518 if (representation.IsByte()) { 4499 __ Store(value, operand, representation);
4519 __ mov_b(operand, value);
4520 } else {
4521 __ mov(operand, value);
4522 }
4523 } 4500 }
4524 4501
4525 if (instr->hydrogen()->NeedsWriteBarrier()) { 4502 if (instr->hydrogen()->NeedsWriteBarrier()) {
4526 Register value = ToRegister(instr->value()); 4503 Register value = ToRegister(instr->value());
4527 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object; 4504 Register temp = access.IsInobject() ? ToRegister(instr->temp()) : object;
4528 // Update the write barrier for the object for in-object properties. 4505 // Update the write barrier for the object for in-object properties.
4529 __ RecordWriteField(write_register, 4506 __ RecordWriteField(write_register,
4530 offset, 4507 offset,
4531 value, 4508 value,
4532 temp, 4509 temp,
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
6389 FixedArray::kHeaderSize - kPointerSize)); 6366 FixedArray::kHeaderSize - kPointerSize));
6390 __ bind(&done); 6367 __ bind(&done);
6391 } 6368 }
6392 6369
6393 6370
6394 #undef __ 6371 #undef __
6395 6372
6396 } } // namespace v8::internal 6373 } } // namespace v8::internal
6397 6374
6398 #endif // V8_TARGET_ARCH_IA32 6375 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-load-elimination.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698