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

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

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: fix tests when ignition is used Created 4 years, 1 month 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-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index ef177fec4c193e0fa9e83f63d680353924d68e7a..8958d7786433765faaaadf4e2ff97311f283912a 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -31,8 +31,10 @@ RUNTIME_FUNCTION(Runtime_FinishArrayPrototypeSetup) {
return Smi::kZero;
}
-static void InstallCode(Isolate* isolate, Handle<JSObject> holder,
- const char* name, Handle<Code> code, int argc = -1) {
+static void InstallCode(
+ Isolate* isolate, Handle<JSObject> holder, const char* name,
+ Handle<Code> code, int argc = -1,
+ BuiltinFunctionId id = static_cast<BuiltinFunctionId>(-1)) {
Handle<String> key = isolate->factory()->InternalizeUtf8String(name);
Handle<JSFunction> optimized =
isolate->factory()->NewFunctionWithoutPrototype(key, code);
@@ -41,15 +43,19 @@ static void InstallCode(Isolate* isolate, Handle<JSObject> holder,
} else {
optimized->shared()->set_internal_formal_parameter_count(argc);
}
+ if (id >= 0) {
+ optimized->shared()->set_builtin_function_id(id);
+ }
JSObject::AddProperty(holder, key, optimized, NONE);
}
-static void InstallBuiltin(Isolate* isolate, Handle<JSObject> holder,
- const char* name, Builtins::Name builtin_name,
- int argc = -1) {
+static void InstallBuiltin(
+ Isolate* isolate, Handle<JSObject> holder, const char* name,
+ Builtins::Name builtin_name, int argc = -1,
+ BuiltinFunctionId id = static_cast<BuiltinFunctionId>(-1)) {
InstallCode(isolate, holder, name,
- handle(isolate->builtins()->builtin(builtin_name), isolate),
- argc);
+ handle(isolate->builtins()->builtin(builtin_name), isolate), argc,
+ id);
}
RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) {
@@ -71,10 +77,12 @@ RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) {
InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice);
InstallBuiltin(isolate, holder, "includes", Builtins::kArrayIncludes, 2);
InstallBuiltin(isolate, holder, "indexOf", Builtins::kArrayIndexOf, 2);
- InstallBuiltin(isolate, holder, "keys", Builtins::kArrayPrototypeKeys, 0);
- InstallBuiltin(isolate, holder, "values", Builtins::kArrayPrototypeValues, 0);
+ InstallBuiltin(isolate, holder, "keys", Builtins::kArrayPrototypeKeys, 0,
+ kArrayKeys);
+ InstallBuiltin(isolate, holder, "values", Builtins::kArrayPrototypeValues, 0,
+ kArrayValues);
InstallBuiltin(isolate, holder, "entries", Builtins::kArrayPrototypeEntries,
- 0);
+ 0, kArrayEntries);
return *holder;
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698