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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 Object); | 699 Object); |
700 } | 700 } |
701 | 701 |
702 | 702 |
703 static MaybeObject* ConstructArgumentsObjectForInlinedFunction( | 703 static MaybeObject* ConstructArgumentsObjectForInlinedFunction( |
704 JavaScriptFrame* frame, | 704 JavaScriptFrame* frame, |
705 Handle<JSFunction> inlined_function, | 705 Handle<JSFunction> inlined_function, |
706 int inlined_frame_index) { | 706 int inlined_frame_index) { |
707 Isolate* isolate = inlined_function->GetIsolate(); | 707 Isolate* isolate = inlined_function->GetIsolate(); |
708 Factory* factory = isolate->factory(); | 708 Factory* factory = isolate->factory(); |
709 SlotRefValueBuilder slot_refs( | 709 Vector<SlotRef> args_slots = |
710 frame, | 710 SlotRef::ComputeSlotMappingForArguments( |
711 inlined_frame_index, | 711 frame, |
712 inlined_function->shared()->formal_parameter_count()); | 712 inlined_frame_index, |
713 | 713 inlined_function->shared()->formal_parameter_count()); |
714 int args_count = slot_refs.args_length(); | 714 int args_count = args_slots.length(); |
715 Handle<JSObject> arguments = | 715 Handle<JSObject> arguments = |
716 factory->NewArgumentsObject(inlined_function, args_count); | 716 factory->NewArgumentsObject(inlined_function, args_count); |
717 Handle<FixedArray> array = factory->NewFixedArray(args_count); | 717 Handle<FixedArray> array = factory->NewFixedArray(args_count); |
718 slot_refs.Prepare(isolate); | |
719 for (int i = 0; i < args_count; ++i) { | 718 for (int i = 0; i < args_count; ++i) { |
720 Handle<Object> value = slot_refs.GetNext(isolate, 0); | 719 Handle<Object> value = args_slots[i].GetValue(isolate); |
721 array->set(i, *value); | 720 array->set(i, *value); |
722 } | 721 } |
723 slot_refs.Finish(isolate); | |
724 arguments->set_elements(*array); | 722 arguments->set_elements(*array); |
| 723 args_slots.Dispose(); |
725 | 724 |
726 // Return the freshly allocated arguments object. | 725 // Return the freshly allocated arguments object. |
727 return *arguments; | 726 return *arguments; |
728 } | 727 } |
729 | 728 |
730 | 729 |
731 MaybeObject* Accessors::FunctionGetArguments(Isolate* isolate, | 730 MaybeObject* Accessors::FunctionGetArguments(Isolate* isolate, |
732 Object* object, | 731 Object* object, |
733 void*) { | 732 void*) { |
734 HandleScope scope(isolate); | 733 HandleScope scope(isolate); |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 info->set_data(Smi::FromInt(index)); | 969 info->set_data(Smi::FromInt(index)); |
971 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 970 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
972 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 971 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
973 info->set_getter(*getter); | 972 info->set_getter(*getter); |
974 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 973 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
975 return info; | 974 return info; |
976 } | 975 } |
977 | 976 |
978 | 977 |
979 } } // namespace v8::internal | 978 } } // namespace v8::internal |
OLD | NEW |