Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Side by Side Diff: src/accessors.cc

Issue 103243005: Captured arguments object materialization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Skip uninteresting frame types when building SlotRefs Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/deoptimizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698