Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index 1ecbde058101da5ccd05eb9497d63bdf97fdefad..1cf04a8dba04d7b7df4a74c379fdd09a0c6516b4 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -568,26 +568,6 @@ Handle<JSObject> NewSloppyArguments(Isolate* isolate, Handle<JSFunction> callee, |
} |
-template <typename T> |
-Handle<JSObject> NewStrictArguments(Isolate* isolate, Handle<JSFunction> callee, |
- T parameters, int argument_count) { |
- Handle<JSObject> result = |
- isolate->factory()->NewArgumentsObject(callee, argument_count); |
- |
- if (argument_count > 0) { |
- Handle<FixedArray> array = |
- isolate->factory()->NewUninitializedFixedArray(argument_count); |
- DisallowHeapAllocation no_gc; |
- WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); |
- for (int i = 0; i < argument_count; i++) { |
- array->set(i, parameters[i], mode); |
- } |
- result->set_elements(*array); |
- } |
- return result; |
-} |
- |
- |
class HandleArguments BASE_EMBEDDED { |
public: |
explicit HandleArguments(Handle<Object>* array) : array_(array) {} |
@@ -624,17 +604,28 @@ RUNTIME_FUNCTION(Runtime_NewSloppyArguments_Generic) { |
} |
-RUNTIME_FUNCTION(Runtime_NewStrictArguments_Generic) { |
+RUNTIME_FUNCTION(Runtime_NewStrictArguments) { |
HandleScope scope(isolate); |
- DCHECK(args.length() == 1); |
+ DCHECK_EQ(1, args.length()); |
CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0); |
// This generic runtime function can also be used when the caller has been |
// inlined, we use the slow but accurate {GetCallerArguments}. |
int argument_count = 0; |
base::SmartArrayPointer<Handle<Object>> arguments = |
GetCallerArguments(isolate, &argument_count); |
- HandleArguments argument_getter(arguments.get()); |
- return *NewStrictArguments(isolate, callee, argument_getter, argument_count); |
+ Handle<JSObject> result = |
+ isolate->factory()->NewArgumentsObject(callee, argument_count); |
+ if (argument_count) { |
+ Handle<FixedArray> array = |
+ isolate->factory()->NewUninitializedFixedArray(argument_count); |
+ DisallowHeapAllocation no_gc; |
+ WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); |
+ for (int i = 0; i < argument_count; i++) { |
+ array->set(i, *arguments[i], mode); |
+ } |
+ result->set_elements(*array); |
+ } |
+ return *result; |
} |
@@ -681,23 +672,6 @@ RUNTIME_FUNCTION(Runtime_NewSloppyArguments) { |
} |
-RUNTIME_FUNCTION(Runtime_NewStrictArguments) { |
- HandleScope scope(isolate); |
- DCHECK(args.length() == 3); |
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, callee, 0) |
- Object** parameters = reinterpret_cast<Object**>(args[1]); |
- CONVERT_SMI_ARG_CHECKED(argument_count, 2); |
-#ifdef DEBUG |
- // This runtime function does not materialize the correct arguments when the |
- // caller has been inlined, better make sure we are not hitting that case. |
- JavaScriptFrameIterator it(isolate); |
- DCHECK(!it.frame()->HasInlinedFrames()); |
-#endif // DEBUG |
- ParameterArguments argument_getter(parameters); |
- return *NewStrictArguments(isolate, callee, argument_getter, argument_count); |
-} |
- |
- |
RUNTIME_FUNCTION(Runtime_NewClosure) { |
HandleScope scope(isolate); |
DCHECK_EQ(1, args.length()); |