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

Unified Diff: src/runtime/runtime-function.cc

Issue 1567393003: [runtime] Make Runtime::GetCallerArguments local to scopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-runtime-rest
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 24ed128f670a039c635e4b39a7277d5e50a33ca5..befd3370984b7b753c21f6bb6c19c3b58b63d4b0 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -7,7 +7,6 @@
#include "src/accessors.h"
#include "src/arguments.h"
#include "src/compiler.h"
-#include "src/deoptimizer.h"
#include "src/frames-inl.h"
#include "src/isolate-inl.h"
#include "src/messages.h"
@@ -247,67 +246,6 @@ RUNTIME_FUNCTION(Runtime_SetForceInlineFlag) {
}
-// Find the arguments of the JavaScript function invocation that called
-// into C++ code. Collect these in a newly allocated array of handles (possibly
-// prefixed by a number of empty handles).
-base::SmartArrayPointer<Handle<Object>> Runtime::GetCallerArguments(
- Isolate* isolate, int prefix_argc, int* total_argc) {
- // Find frame containing arguments passed to the caller.
- JavaScriptFrameIterator it(isolate);
- JavaScriptFrame* frame = it.frame();
- List<JSFunction*> functions(2);
- frame->GetFunctions(&functions);
- if (functions.length() > 1) {
- int inlined_jsframe_index = functions.length() - 1;
- TranslatedState translated_values(frame);
- translated_values.Prepare(false, frame->fp());
-
- int argument_count = 0;
- TranslatedFrame* translated_frame =
- translated_values.GetArgumentsInfoFromJSFrameIndex(
- inlined_jsframe_index, &argument_count);
- TranslatedFrame::iterator iter = translated_frame->begin();
-
- // Skip the function.
- iter++;
-
- // Skip the receiver.
- iter++;
- argument_count--;
-
- *total_argc = prefix_argc + argument_count;
- base::SmartArrayPointer<Handle<Object> > param_data(
- NewArray<Handle<Object> >(*total_argc));
- bool should_deoptimize = false;
- for (int i = 0; i < argument_count; i++) {
- should_deoptimize = should_deoptimize || iter->IsMaterializedObject();
- Handle<Object> value = iter->GetValue();
- param_data[prefix_argc + i] = value;
- iter++;
- }
-
- if (should_deoptimize) {
- translated_values.StoreMaterializedValuesAndDeopt();
- }
-
- return param_data;
- } else {
- it.AdvanceToArgumentsFrame();
- frame = it.frame();
- int args_count = frame->ComputeParametersCount();
-
- *total_argc = prefix_argc + args_count;
- base::SmartArrayPointer<Handle<Object> > param_data(
- NewArray<Handle<Object> >(*total_argc));
- for (int i = 0; i < args_count; i++) {
- Handle<Object> val = Handle<Object>(frame->GetParameter(i), isolate);
- param_data[prefix_argc + i] = val;
- }
- return param_data;
- }
-}
-
-
RUNTIME_FUNCTION(Runtime_Call) {
HandleScope scope(isolate);
DCHECK_LE(2, args.length());
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698