| 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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); | 1976 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); |
| 1977 // Load the map's "bit field 2" into |result|. We only need the first byte, | 1977 // Load the map's "bit field 2" into |result|. We only need the first byte, |
| 1978 // but the following masking takes care of that anyway. | 1978 // but the following masking takes care of that anyway. |
| 1979 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); | 1979 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); |
| 1980 // Retrieve elements_kind from bit field 2. | 1980 // Retrieve elements_kind from bit field 2. |
| 1981 __ and_(result, Map::kElementsKindMask); | 1981 __ and_(result, Map::kElementsKindMask); |
| 1982 __ shr(result, Map::kElementsKindShift); | 1982 __ shr(result, Map::kElementsKindShift); |
| 1983 } | 1983 } |
| 1984 | 1984 |
| 1985 | 1985 |
| 1986 void LCodeGen::DoValueOf(LValueOf* instr) { | |
| 1987 Register input = ToRegister(instr->value()); | |
| 1988 Register result = ToRegister(instr->result()); | |
| 1989 Register map = ToRegister(instr->temp()); | |
| 1990 ASSERT(input.is(result)); | |
| 1991 | |
| 1992 Label done; | |
| 1993 | |
| 1994 if (!instr->hydrogen()->value()->IsHeapObject()) { | |
| 1995 // If the object is a smi return the object. | |
| 1996 __ JumpIfSmi(input, &done, Label::kNear); | |
| 1997 } | |
| 1998 | |
| 1999 // If the object is not a value type, return the object. | |
| 2000 __ CmpObjectType(input, JS_VALUE_TYPE, map); | |
| 2001 __ j(not_equal, &done, Label::kNear); | |
| 2002 __ mov(result, FieldOperand(input, JSValue::kValueOffset)); | |
| 2003 | |
| 2004 __ bind(&done); | |
| 2005 } | |
| 2006 | |
| 2007 | |
| 2008 void LCodeGen::DoDateField(LDateField* instr) { | 1986 void LCodeGen::DoDateField(LDateField* instr) { |
| 2009 Register object = ToRegister(instr->date()); | 1987 Register object = ToRegister(instr->date()); |
| 2010 Register result = ToRegister(instr->result()); | 1988 Register result = ToRegister(instr->result()); |
| 2011 Register scratch = ToRegister(instr->temp()); | 1989 Register scratch = ToRegister(instr->temp()); |
| 2012 Smi* index = instr->index(); | 1990 Smi* index = instr->index(); |
| 2013 Label runtime, done; | 1991 Label runtime, done; |
| 2014 ASSERT(object.is(result)); | 1992 ASSERT(object.is(result)); |
| 2015 ASSERT(object.is(eax)); | 1993 ASSERT(object.is(eax)); |
| 2016 | 1994 |
| 2017 __ test(object, Immediate(kSmiTagMask)); | 1995 __ test(object, Immediate(kSmiTagMask)); |
| (...skipping 4301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6319 FixedArray::kHeaderSize - kPointerSize)); | 6297 FixedArray::kHeaderSize - kPointerSize)); |
| 6320 __ bind(&done); | 6298 __ bind(&done); |
| 6321 } | 6299 } |
| 6322 | 6300 |
| 6323 | 6301 |
| 6324 #undef __ | 6302 #undef __ |
| 6325 | 6303 |
| 6326 } } // namespace v8::internal | 6304 } } // namespace v8::internal |
| 6327 | 6305 |
| 6328 #endif // V8_TARGET_ARCH_IA32 | 6306 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |