| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 Register dst, Register src, | 259 Register dst, Register src, |
| 260 JSObject* holder, int index) { | 260 JSObject* holder, int index) { |
| 261 // Adjust for the number of properties stored in the holder. | 261 // Adjust for the number of properties stored in the holder. |
| 262 index -= holder->map()->inobject_properties(); | 262 index -= holder->map()->inobject_properties(); |
| 263 if (index < 0) { | 263 if (index < 0) { |
| 264 // Get the property straight out of the holder. | 264 // Get the property straight out of the holder. |
| 265 int offset = holder->map()->instance_size() + (index * kPointerSize); | 265 int offset = holder->map()->instance_size() + (index * kPointerSize); |
| 266 __ mov(dst, FieldOperand(src, offset)); | 266 __ mov(dst, FieldOperand(src, offset)); |
| 267 } else { | 267 } else { |
| 268 // Calculate the offset into the properties array. | 268 // Calculate the offset into the properties array. |
| 269 int offset = index * kPointerSize + Array::kHeaderSize; | 269 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 270 __ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset)); | 270 __ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset)); |
| 271 __ mov(dst, FieldOperand(dst, offset)); | 271 __ mov(dst, FieldOperand(dst, offset)); |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 | 275 |
| 276 | |
| 277 | |
| 278 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) { | 276 void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) { |
| 279 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC); | 277 ASSERT(kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC); |
| 280 Code* code = NULL; | 278 Code* code = NULL; |
| 281 if (kind == Code::LOAD_IC) { | 279 if (kind == Code::LOAD_IC) { |
| 282 code = Builtins::builtin(Builtins::LoadIC_Miss); | 280 code = Builtins::builtin(Builtins::LoadIC_Miss); |
| 283 } else { | 281 } else { |
| 284 code = Builtins::builtin(Builtins::KeyedLoadIC_Miss); | 282 code = Builtins::builtin(Builtins::KeyedLoadIC_Miss); |
| 285 } | 283 } |
| 286 | 284 |
| 287 Handle<Code> ic(code); | 285 Handle<Code> ic(code); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // Set the property straight into the object. | 340 // Set the property straight into the object. |
| 343 int offset = object->map()->instance_size() + (index * kPointerSize); | 341 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 344 __ mov(FieldOperand(receiver_reg, offset), eax); | 342 __ mov(FieldOperand(receiver_reg, offset), eax); |
| 345 | 343 |
| 346 // Update the write barrier for the array address. | 344 // Update the write barrier for the array address. |
| 347 // Pass the value being stored in the now unused name_reg. | 345 // Pass the value being stored in the now unused name_reg. |
| 348 __ mov(name_reg, Operand(eax)); | 346 __ mov(name_reg, Operand(eax)); |
| 349 __ RecordWrite(receiver_reg, offset, name_reg, scratch); | 347 __ RecordWrite(receiver_reg, offset, name_reg, scratch); |
| 350 } else { | 348 } else { |
| 351 // Write to the properties array. | 349 // Write to the properties array. |
| 352 int offset = index * kPointerSize + Array::kHeaderSize; | 350 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 353 // Get the properties array (optimistically). | 351 // Get the properties array (optimistically). |
| 354 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 352 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 355 __ mov(FieldOperand(scratch, offset), eax); | 353 __ mov(FieldOperand(scratch, offset), eax); |
| 356 | 354 |
| 357 // Update the write barrier for the array address. | 355 // Update the write barrier for the array address. |
| 358 // Pass the value being stored in the now unused name_reg. | 356 // Pass the value being stored in the now unused name_reg. |
| 359 __ mov(name_reg, Operand(eax)); | 357 __ mov(name_reg, Operand(eax)); |
| 360 __ RecordWrite(scratch, offset, name_reg, receiver_reg); | 358 __ RecordWrite(scratch, offset, name_reg, receiver_reg); |
| 361 } | 359 } |
| 362 | 360 |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1428 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1431 | 1429 |
| 1432 // Return the generated code. | 1430 // Return the generated code. |
| 1433 return GetCode(CALLBACKS, name); | 1431 return GetCode(CALLBACKS, name); |
| 1434 } | 1432 } |
| 1435 | 1433 |
| 1436 | 1434 |
| 1437 #undef __ | 1435 #undef __ |
| 1438 | 1436 |
| 1439 } } // namespace v8::internal | 1437 } } // namespace v8::internal |
| OLD | NEW |