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

Unified Diff: src/execution.cc

Issue 895053002: Move the contents of api-natives.js to c++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.h ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 9f418ac5d843e0a1f300974313e5c404e28d58fb..8cb3317cff6f58cb535e8a977cd95f2fce79a0c7 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -630,73 +630,6 @@ Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) {
}
-MaybeHandle<JSFunction> Execution::InstantiateFunction(
- Handle<FunctionTemplateInfo> data) {
- Isolate* isolate = data->GetIsolate();
- if (!data->do_not_cache()) {
- // Fast case: see if the function has already been instantiated
- int serial_number = Smi::cast(data->serial_number())->value();
- Handle<JSObject> cache(isolate->native_context()->function_cache());
- Handle<Object> elm =
- Object::GetElement(isolate, cache, serial_number).ToHandleChecked();
- if (elm->IsJSFunction()) return Handle<JSFunction>::cast(elm);
- }
- // The function has not yet been instantiated in this context; do it.
- Handle<Object> args[] = { data };
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, result,
- Call(isolate,
- isolate->instantiate_fun(),
- isolate->js_builtins_object(),
- arraysize(args),
- args),
- JSFunction);
- return Handle<JSFunction>::cast(result);
-}
-
-
-MaybeHandle<JSObject> Execution::InstantiateObject(
- Handle<ObjectTemplateInfo> data) {
- Isolate* isolate = data->GetIsolate();
- Handle<Object> result;
- if (data->property_list()->IsUndefined() &&
- !data->constructor()->IsUndefined()) {
- Handle<FunctionTemplateInfo> cons_template =
- Handle<FunctionTemplateInfo>(
- FunctionTemplateInfo::cast(data->constructor()));
- Handle<JSFunction> cons;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, cons, InstantiateFunction(cons_template), JSObject);
- ASSIGN_RETURN_ON_EXCEPTION(isolate, result, New(cons, 0, NULL), JSObject);
- } else {
- Handle<Object> args[] = { data };
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate, result,
- Call(isolate,
- isolate->instantiate_fun(),
- isolate->js_builtins_object(),
- arraysize(args),
- args),
- JSObject);
- }
- return Handle<JSObject>::cast(result);
-}
-
-
-MaybeHandle<Object> Execution::ConfigureInstance(
- Isolate* isolate,
- Handle<Object> instance,
- Handle<Object> instance_template) {
- Handle<Object> args[] = { instance, instance_template };
- return Execution::Call(isolate,
- isolate->configure_instance_fun(),
- isolate->js_builtins_object(),
- arraysize(args),
- args);
-}
-
-
Handle<String> Execution::GetStackTraceLine(Handle<Object> recv,
Handle<JSFunction> fun,
Handle<Object> pos,
« no previous file with comments | « src/execution.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698