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