OLD | NEW |
---|---|
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 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1266 __ and_(result, Map::kElementsKindMask); | 1266 __ and_(result, Map::kElementsKindMask); |
1267 __ shr(result, Map::kElementsKindShift); | 1267 __ shr(result, Map::kElementsKindShift); |
1268 } | 1268 } |
1269 | 1269 |
1270 | 1270 |
1271 void LCodeGen::DoValueOf(LValueOf* instr) { | 1271 void LCodeGen::DoValueOf(LValueOf* instr) { |
1272 Register input = ToRegister(instr->InputAt(0)); | 1272 Register input = ToRegister(instr->InputAt(0)); |
1273 Register result = ToRegister(instr->result()); | 1273 Register result = ToRegister(instr->result()); |
1274 Register map = ToRegister(instr->TempAt(0)); | 1274 Register map = ToRegister(instr->TempAt(0)); |
1275 ASSERT(input.is(result)); | 1275 ASSERT(input.is(result)); |
1276 | |
1276 Label done; | 1277 Label done; |
1277 // If the object is a smi return the object. | 1278 // If the object is a smi return the object. |
1278 __ JumpIfSmi(input, &done, Label::kNear); | 1279 __ JumpIfSmi(input, &done, Label::kNear); |
1279 | 1280 |
1280 // If the object is not a value type, return the object. | 1281 // If the object is not a value type, return the object. |
1281 __ CmpObjectType(input, JS_VALUE_TYPE, map); | 1282 __ CmpObjectType(input, JS_VALUE_TYPE, map); |
1282 __ j(not_equal, &done, Label::kNear); | 1283 __ j(not_equal, &done, Label::kNear); |
1283 __ mov(result, FieldOperand(input, JSValue::kValueOffset)); | 1284 __ mov(result, FieldOperand(input, JSValue::kValueOffset)); |
1284 | 1285 |
1285 __ bind(&done); | 1286 __ bind(&done); |
1286 } | 1287 } |
1287 | 1288 |
1288 | 1289 |
1290 void LCodeGen::DoDateField(LDateField* instr) { | |
1291 Register input = ToRegister(instr->InputAt(0)); | |
1292 Register result = ToRegister(instr->result()); | |
1293 Register map = ToRegister(instr->TempAt(0)); | |
1294 ASSERT(input.is(result)); | |
1295 | |
1296 #ifdef DEBUG | |
rossberg
2012/03/06 15:55:50
This one got removed, too.
| |
1297 __ AbortIfSmi(input); | |
1298 __ CmpObjectType(input, JS_DATE_TYPE, map); | |
1299 __ Assert(equal, "Trying to get date field from non-date."); | |
1300 #endif | |
1301 | |
1302 __ mov(result, FieldOperand(input, | |
1303 JSDate::kValueOffset + kPointerSize * instr->index())); | |
1304 } | |
1305 | |
1306 | |
1307 void LCodeGen::DoSetDateField(LSetDateField* instr) { | |
1308 Register date = ToRegister(instr->InputAt(0)); | |
1309 Register value = ToRegister(instr->InputAt(1)); | |
1310 Register result = ToRegister(instr->result()); | |
1311 Register temp = ToRegister(instr->TempAt(0)); | |
1312 int index = instr->index(); | |
1313 | |
1314 #ifdef DEBUG | |
1315 __ AbortIfSmi(date); | |
1316 __ CmpObjectType(date, JS_DATE_TYPE, temp); | |
1317 __ Assert(equal, "Trying to get date field from non-date."); | |
1318 #endif | |
1319 | |
1320 __ mov(FieldOperand(date, JSDate::kValueOffset + kPointerSize * index), | |
1321 value); | |
1322 // Caches can only be smi or NaN, so we can skip the write barrier for them. | |
1323 if (index < JSDate::kFirstBarrierFree) { | |
1324 // Update the write barrier. Save the value as it will be | |
1325 // overwritten by the write barrier code and is needed afterward. | |
1326 __ mov(result, value); | |
1327 __ RecordWriteField(date, JSDate::kValueOffset + kPointerSize * index, | |
1328 value, temp, kDontSaveFPRegs); | |
1329 } | |
1330 } | |
1331 | |
1332 | |
1289 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 1333 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
1290 LOperand* input = instr->InputAt(0); | 1334 LOperand* input = instr->InputAt(0); |
1291 ASSERT(input->Equals(instr->result())); | 1335 ASSERT(input->Equals(instr->result())); |
1292 __ not_(ToRegister(input)); | 1336 __ not_(ToRegister(input)); |
1293 } | 1337 } |
1294 | 1338 |
1295 | 1339 |
1296 void LCodeGen::DoThrow(LThrow* instr) { | 1340 void LCodeGen::DoThrow(LThrow* instr) { |
1297 __ push(ToOperand(instr->value())); | 1341 __ push(ToOperand(instr->value())); |
1298 ASSERT(ToRegister(instr->context()).is(esi)); | 1342 ASSERT(ToRegister(instr->context()).is(esi)); |
(...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4850 FixedArray::kHeaderSize - kPointerSize)); | 4894 FixedArray::kHeaderSize - kPointerSize)); |
4851 __ bind(&done); | 4895 __ bind(&done); |
4852 } | 4896 } |
4853 | 4897 |
4854 | 4898 |
4855 #undef __ | 4899 #undef __ |
4856 | 4900 |
4857 } } // namespace v8::internal | 4901 } } // namespace v8::internal |
4858 | 4902 |
4859 #endif // V8_TARGET_ARCH_IA32 | 4903 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |