| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Return and remove the on-stack parameters. | 300 // Return and remove the on-stack parameters. |
| 301 __ mov(esi, eax); | 301 __ mov(esi, eax); |
| 302 __ ret(2 * kPointerSize); | 302 __ ret(2 * kPointerSize); |
| 303 | 303 |
| 304 // Need to collect. Call into runtime system. | 304 // Need to collect. Call into runtime system. |
| 305 __ bind(&gc); | 305 __ bind(&gc); |
| 306 __ TailCallRuntime(Runtime::kPushBlockContext, 2, 1); | 306 __ TailCallRuntime(Runtime::kPushBlockContext, 2, 1); |
| 307 } | 307 } |
| 308 | 308 |
| 309 | 309 |
| 310 int FastCloneShallowArrayStub::MaximumClonedLength() { |
| 311 return 8; |
| 312 } |
| 313 |
| 314 |
| 310 static void GenerateFastCloneShallowArrayCommon( | 315 static void GenerateFastCloneShallowArrayCommon( |
| 311 MacroAssembler* masm, | 316 MacroAssembler* masm, |
| 312 int length, | 317 int length, |
| 313 FastCloneShallowArrayStub::Mode mode, | 318 FastCloneShallowArrayStub::Mode mode, |
| 314 Label* fail) { | 319 Label* fail) { |
| 315 // Registers on entry: | 320 // Registers on entry: |
| 316 // | 321 // |
| 317 // ecx: boilerplate literal array. | 322 // ecx: boilerplate literal array. |
| 318 ASSERT(mode != FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS); | 323 ASSERT(mode != FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS); |
| 319 | 324 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 441 |
| 437 GenerateFastCloneShallowArrayCommon(masm, length_, mode, &slow_case); | 442 GenerateFastCloneShallowArrayCommon(masm, length_, mode, &slow_case); |
| 438 // Return and remove the on-stack parameters. | 443 // Return and remove the on-stack parameters. |
| 439 __ ret(3 * kPointerSize); | 444 __ ret(3 * kPointerSize); |
| 440 | 445 |
| 441 __ bind(&slow_case); | 446 __ bind(&slow_case); |
| 442 __ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1); | 447 __ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1); |
| 443 } | 448 } |
| 444 | 449 |
| 445 | 450 |
| 451 int FastCloneShallowObjectStub::MaximumClonedProperties() { |
| 452 return 6; |
| 453 } |
| 454 |
| 455 |
| 446 void FastCloneShallowObjectStub::Generate(MacroAssembler* masm) { | 456 void FastCloneShallowObjectStub::Generate(MacroAssembler* masm) { |
| 447 // Stack layout on entry: | 457 // Stack layout on entry: |
| 448 // | 458 // |
| 449 // [esp + kPointerSize]: object literal flags. | 459 // [esp + kPointerSize]: object literal flags. |
| 450 // [esp + (2 * kPointerSize)]: constant properties. | 460 // [esp + (2 * kPointerSize)]: constant properties. |
| 451 // [esp + (3 * kPointerSize)]: literal index. | 461 // [esp + (3 * kPointerSize)]: literal index. |
| 452 // [esp + (4 * kPointerSize)]: literals array. | 462 // [esp + (4 * kPointerSize)]: literals array. |
| 453 | 463 |
| 454 // Load boilerplate object into ecx and check if we need to create a | 464 // Load boilerplate object into ecx and check if we need to create a |
| 455 // boilerplate. | 465 // boilerplate. |
| (...skipping 7048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7504 // Restore ecx. | 7514 // Restore ecx. |
| 7505 __ pop(ecx); | 7515 __ pop(ecx); |
| 7506 __ ret(0); | 7516 __ ret(0); |
| 7507 } | 7517 } |
| 7508 | 7518 |
| 7509 #undef __ | 7519 #undef __ |
| 7510 | 7520 |
| 7511 } } // namespace v8::internal | 7521 } } // namespace v8::internal |
| 7512 | 7522 |
| 7513 #endif // V8_TARGET_ARCH_IA32 | 7523 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |