Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 | 336 |
| 337 // Return and remove the on-stack parameters. | 337 // Return and remove the on-stack parameters. |
| 338 __ add(sp, sp, Operand(3 * kPointerSize)); | 338 __ add(sp, sp, Operand(3 * kPointerSize)); |
| 339 __ Ret(); | 339 __ Ret(); |
| 340 | 340 |
| 341 __ bind(&slow_case); | 341 __ bind(&slow_case); |
| 342 __ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1); | 342 __ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1); |
| 343 } | 343 } |
| 344 | 344 |
| 345 | 345 |
| 346 void FastCloneShallowObjectStub::Generate(MacroAssembler* masm) { | |
| 347 // Stack layout on entry: | |
| 348 // | |
| 349 // [sp]: object literal flags. | |
| 350 // [sp + kPointerSize]: constant properties. | |
| 351 // [sp + (2 * kPointerSize)]: literal index. | |
| 352 // [sp + (3 * kPointerSize)]: literals array. | |
| 353 | |
| 354 // Load boilerplate object into r3 and check if we need to create a | |
| 355 // boilerplate. | |
| 356 Label slow_case; | |
| 357 __ ldr(r3, MemOperand(sp, 3 * kPointerSize)); | |
| 358 __ ldr(r0, MemOperand(sp, 2 * kPointerSize)); | |
| 359 __ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | |
| 360 __ ldr(r3, MemOperand(r3, r0, LSL, kPointerSizeLog2 - kSmiTagSize)); | |
| 361 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | |
| 362 __ cmp(r3, ip); | |
|
Erik Corry
2011/11/23 14:14:15
Seems like you could use CompareRoot here.
Michael Starzinger
2011/11/23 15:02:03
Done.
| |
| 363 __ b(eq, &slow_case); | |
| 364 | |
| 365 // Check that the boilerplate contains only fast properties and we can | |
| 366 // statically determine the instance size. | |
|
Erik Corry
2011/11/23 14:14:15
As discussed offline this can be omitted for MOAR
| |
| 367 int size = JSObject::kHeaderSize + length_ * kPointerSize; | |
| 368 __ ldr(r0, FieldMemOperand(r3, HeapObject::kMapOffset)); | |
| 369 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceSizeOffset)); | |
| 370 __ cmp(r0, Operand(size >> kPointerSizeLog2)); | |
| 371 __ b(ne, &slow_case); | |
| 372 | |
| 373 // Allocate the JS object and copy header together with all in-object | |
| 374 // properties from the boilerplate. | |
| 375 __ AllocateInNewSpace(size, r0, r1, r2, &slow_case, TAG_OBJECT); | |
| 376 for (int i = 0; i < size; i += kPointerSize) { | |
| 377 __ ldr(r1, FieldMemOperand(r3, i)); | |
| 378 __ str(r1, FieldMemOperand(r0, i)); | |
| 379 } | |
| 380 | |
| 381 // Return and remove the on-stack parameters. | |
| 382 __ add(sp, sp, Operand(4 * kPointerSize)); | |
| 383 __ Ret(); | |
| 384 | |
| 385 __ bind(&slow_case); | |
| 386 __ TailCallRuntime(Runtime::kCreateObjectLiteralShallow, 4, 1); | |
| 387 } | |
| 388 | |
| 389 | |
| 346 // Takes a Smi and converts to an IEEE 64 bit floating point value in two | 390 // Takes a Smi and converts to an IEEE 64 bit floating point value in two |
| 347 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and | 391 // registers. The format is 1 sign bit, 11 exponent bits (biased 1023) and |
| 348 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a | 392 // 52 fraction bits (20 in the first word, 32 in the second). Zeros is a |
| 349 // scratch register. Destroys the source register. No GC occurs during this | 393 // scratch register. Destroys the source register. No GC occurs during this |
| 350 // stub so you don't have to set up the frame. | 394 // stub so you don't have to set up the frame. |
| 351 class ConvertToDoubleStub : public CodeStub { | 395 class ConvertToDoubleStub : public CodeStub { |
| 352 public: | 396 public: |
| 353 ConvertToDoubleStub(Register result_reg_1, | 397 ConvertToDoubleStub(Register result_reg_1, |
| 354 Register result_reg_2, | 398 Register result_reg_2, |
| 355 Register source_reg, | 399 Register source_reg, |
| (...skipping 6823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7179 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, | 7223 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, |
| 7180 &slow_elements); | 7224 &slow_elements); |
| 7181 __ Ret(); | 7225 __ Ret(); |
| 7182 } | 7226 } |
| 7183 | 7227 |
| 7184 #undef __ | 7228 #undef __ |
| 7185 | 7229 |
| 7186 } } // namespace v8::internal | 7230 } } // namespace v8::internal |
| 7187 | 7231 |
| 7188 #endif // V8_TARGET_ARCH_ARM | 7232 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |