OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 794 |
795 // Skip the receiver. | 795 // Skip the receiver. |
796 iter++; | 796 iter++; |
797 argument_count--; | 797 argument_count--; |
798 | 798 |
799 Handle<JSObject> arguments = | 799 Handle<JSObject> arguments = |
800 factory->NewArgumentsObject(inlined_function, argument_count); | 800 factory->NewArgumentsObject(inlined_function, argument_count); |
801 Handle<FixedArray> array = factory->NewFixedArray(argument_count); | 801 Handle<FixedArray> array = factory->NewFixedArray(argument_count); |
802 bool should_deoptimize = false; | 802 bool should_deoptimize = false; |
803 for (int i = 0; i < argument_count; ++i) { | 803 for (int i = 0; i < argument_count; ++i) { |
804 // If we materialize any object, we should deopt because we might alias | 804 // If we materialize any object, we should deoptimize the frame because we |
805 // an object that was eliminated by escape analysis. | 805 // might alias an object that was eliminated by escape analysis. |
806 should_deoptimize = should_deoptimize || iter->IsMaterializedObject(); | 806 should_deoptimize = should_deoptimize || iter->IsMaterializedObject(); |
807 Handle<Object> value = iter->GetValue(); | 807 Handle<Object> value = iter->GetValue(); |
808 array->set(i, *value); | 808 array->set(i, *value); |
809 iter++; | 809 iter++; |
810 } | 810 } |
811 arguments->set_elements(*array); | 811 arguments->set_elements(*array); |
812 | 812 |
813 if (should_deoptimize) { | 813 if (should_deoptimize) { |
814 translated_values.StoreMaterializedValuesAndDeopt(); | 814 translated_values.StoreMaterializedValuesAndDeopt(frame); |
815 } | 815 } |
816 | 816 |
817 // Return the freshly allocated arguments object. | 817 // Return the freshly allocated arguments object. |
818 return arguments; | 818 return arguments; |
819 } | 819 } |
820 | 820 |
821 | 821 |
822 static int FindFunctionInFrame(JavaScriptFrame* frame, | 822 static int FindFunctionInFrame(JavaScriptFrame* frame, |
823 Handle<JSFunction> function) { | 823 Handle<JSFunction> function) { |
824 DisallowHeapAllocation no_allocation; | 824 DisallowHeapAllocation no_allocation; |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, | 1224 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, |
1225 PropertyAttributes attributes) { | 1225 PropertyAttributes attributes) { |
1226 Handle<AccessorInfo> info = | 1226 Handle<AccessorInfo> info = |
1227 MakeAccessor(isolate, isolate->factory()->stack_string(), | 1227 MakeAccessor(isolate, isolate->factory()->stack_string(), |
1228 &ErrorStackGetter, &ErrorStackSetter, attributes); | 1228 &ErrorStackGetter, &ErrorStackSetter, attributes); |
1229 return info; | 1229 return info; |
1230 } | 1230 } |
1231 | 1231 |
1232 } // namespace internal | 1232 } // namespace internal |
1233 } // namespace v8 | 1233 } // namespace v8 |
OLD | NEW |