Hey Dmitriy,

Each JSObject contains at least three fields, the map, the properties
backing store and the elements backing store. The first movp in the code
you point to initializes the map, the next two initializes the backing
stores to empty arrays.

HTH,
Benedikt


Benedikt Meurer |  Software Engineer, V8 |  Google Germany GmbH |
Erika-Mann-Str.
33, 80636 München

Registergericht und -nummer: Hamburg, HRB 86891 | Sitz der Gesellschaft:
Hamburg | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

On Mon, Feb 20, 2017 at 5:47 AM, Dmitriy - <[email protected]> wrote:

> Hi, I've met this code in V8:
>
> void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
>   ZoneList<Expression*>* args = expr->arguments();
>   DCHECK_EQ(2, args->length());
>   VisitForStackValue(args->at(0));
>   VisitForStackValue(args->at(1));
>
>   Label runtime, done;
>
>   __ Allocate(JSIteratorResult::kSize, rax, rcx, rdx, &runtime, TAG_OBJECT
> );
>   __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, rbx);
>   __ movp(FieldOperand(rax, HeapObject::kMapOffset), rbx);
>   __ LoadRoot(rbx, Heap::kEmptyFixedArrayRootIndex);
>   __ movp(FieldOperand(rax, JSObject::kPropertiesOffset), rbx);
>   __ movp(FieldOperand(rax, JSObject::kElementsOffset), rbx);
>
> The last two mov's instruction looks strange. What have you wanted to
> reach?
>
> --
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to