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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 | 1254 |
1255 // If the object is not a value type, return the object. | 1255 // If the object is not a value type, return the object. |
1256 __ GetObjectType(input, map, map); | 1256 __ GetObjectType(input, map, map); |
1257 __ Branch(&done, ne, map, Operand(JS_VALUE_TYPE)); | 1257 __ Branch(&done, ne, map, Operand(JS_VALUE_TYPE)); |
1258 __ lw(result, FieldMemOperand(input, JSValue::kValueOffset)); | 1258 __ lw(result, FieldMemOperand(input, JSValue::kValueOffset)); |
1259 | 1259 |
1260 __ bind(&done); | 1260 __ bind(&done); |
1261 } | 1261 } |
1262 | 1262 |
1263 | 1263 |
| 1264 void LCodeGen::DoDateField(LDateField* instr) { |
| 1265 Register object = ToRegister(instr->InputAt(0)); |
| 1266 Register result = ToRegister(instr->result()); |
| 1267 Register scratch = ToRegister(instr->TempAt(0)); |
| 1268 Smi* index = instr->index(); |
| 1269 Label runtime, done; |
| 1270 ASSERT(object.is(a0)); |
| 1271 ASSERT(result.is(v0)); |
| 1272 ASSERT(!scratch.is(scratch0())); |
| 1273 ASSERT(!scratch.is(object)); |
| 1274 |
| 1275 #ifdef DEBUG |
| 1276 __ AbortIfSmi(object); |
| 1277 __ GetObjectType(object, scratch, scratch); |
| 1278 __ Assert(eq, "Trying to get date field from non-date.", |
| 1279 scratch, Operand(JS_DATE_TYPE)); |
| 1280 #endif |
| 1281 |
| 1282 if (index->value() == 0) { |
| 1283 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); |
| 1284 } else { |
| 1285 if (index->value() < JSDate::kFirstUncachedField) { |
| 1286 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1287 __ li(scratch, Operand(stamp)); |
| 1288 __ lw(scratch, MemOperand(scratch)); |
| 1289 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
| 1290 __ Branch(&runtime, ne, scratch, Operand(scratch0())); |
| 1291 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset + |
| 1292 kPointerSize * index->value())); |
| 1293 __ jmp(&done); |
| 1294 } |
| 1295 __ bind(&runtime); |
| 1296 __ PrepareCallCFunction(2, scratch); |
| 1297 __ li(a1, Operand(index)); |
| 1298 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
| 1299 __ bind(&done); |
| 1300 } |
| 1301 } |
| 1302 |
| 1303 |
1264 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 1304 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
1265 Register input = ToRegister(instr->InputAt(0)); | 1305 Register input = ToRegister(instr->InputAt(0)); |
1266 Register result = ToRegister(instr->result()); | 1306 Register result = ToRegister(instr->result()); |
1267 __ Nor(result, zero_reg, Operand(input)); | 1307 __ Nor(result, zero_reg, Operand(input)); |
1268 } | 1308 } |
1269 | 1309 |
1270 | 1310 |
1271 void LCodeGen::DoThrow(LThrow* instr) { | 1311 void LCodeGen::DoThrow(LThrow* instr) { |
1272 Register input_reg = EmitLoadRegister(instr->InputAt(0), at); | 1312 Register input_reg = EmitLoadRegister(instr->InputAt(0), at); |
1273 __ push(input_reg); | 1313 __ push(input_reg); |
(...skipping 3732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5006 __ Subu(scratch, result, scratch); | 5046 __ Subu(scratch, result, scratch); |
5007 __ lw(result, FieldMemOperand(scratch, | 5047 __ lw(result, FieldMemOperand(scratch, |
5008 FixedArray::kHeaderSize - kPointerSize)); | 5048 FixedArray::kHeaderSize - kPointerSize)); |
5009 __ bind(&done); | 5049 __ bind(&done); |
5010 } | 5050 } |
5011 | 5051 |
5012 | 5052 |
5013 #undef __ | 5053 #undef __ |
5014 | 5054 |
5015 } } // namespace v8::internal | 5055 } } // namespace v8::internal |
OLD | NEW |