Home | History | Annotate | Download | only in src

Lines Matching full:prototype

279   // object and overrides the prototype in 'to' with the one from
300 // prototype for the processing of JS builtins. Later the function maps are
301 // replaced in order to make prototype writable. These are the final, writable
302 // prototype, maps.
386 Handle<JSObject> prototype;
388 maybe_prototype.ToHandle(&prototype)
389 ? factory->NewFunction(name, call_code, prototype, type,
544 // Functions with this map will not have a 'prototype' property, and
553 // Later the map is replaced with writable prototype map, allocated below.
560 // The final map for functions. Writeable prototype.
583 // Allocate a new prototype for the object function.
589 // Ban re-setting Object.prototype.__proto__ to prevent Proxy security bug
594 // For bootstrapping set the array prototype to be the same as the object
595 // prototype, otherwise the missing initial_array_prototype will cause
602 // Allocate the empty function as the prototype for function - ES6 19.2.3
607 // Allocate the function map first and then patch the prototype later
693 // Allocate map for the prototype-less strict mode instances.
701 // Later the map is replaced with writable prototype map, allocated below.
706 // The final map for the strict mode functions. Writeable prototype.
775 // maps in the native context. The "prototype" property descriptor is
981 // Get prototype template of the global_proxy_template.
998 Handle<JSObject> prototype =
1001 name, code, prototype, JS_GLOBAL_OBJECT_TYPE, JSGlobalObject::kSize);
1003 LookupIterator it(prototype, factory()->constructor_string(),
1121 Handle<JSObject> prototype =
1124 JSObject::AddProperty(prototype, factory->name_string(), name, DONT_ENUM);
1125 JSObject::AddProperty(prototype, factory->message_string(),
1127 JSObject::AddProperty(prototype, factory->constructor_string(), error_fun,
1132 SimpleInstallFunction(prototype, factory->toString_string(),
1138 InstallFunction(prototype, isolate->error_to_string(),
1145 CHECK(JSReceiver::SetPrototype(prototype,
1146 handle(global_error->prototype(), isolate),
1151 Accessors::FunctionSetPrototype(error_fun, prototype).Assert();
1300 Handle<JSFunction> prototype = empty_function;
1303 prototype, Builtins::kFunctionConstructor);
1314 SimpleInstallFunction(prototype, factory->apply_string(),
1316 SimpleInstallFunction(prototype, factory->bind_string(),
1318 SimpleInstallFunction(prototype, factory->call_string(),
1320 SimpleInstallFunction(prototype, factory->toString_string(),
1325 prototype, factory->has_instance_symbol(), JS_OBJECT_TYPE,
1339 JSObject::AddProperty(prototype, factory->constructor_string(),
1508 Handle<JSValue> prototype =
1510 prototype->set_value(Smi::kZero);
1511 Accessors::FunctionSetPrototype(number_fun, prototype).Assert();
1513 // Install the "constructor" property on the {prototype}.
1514 JSObject::AddProperty(prototype, factory->constructor_string(), number_fun,
1517 // Install the Number.prototype methods.
1518 SimpleInstallFunction(prototype, "toExponential",
1520 SimpleInstallFunction(prototype, "toFixed",
1522 SimpleInstallFunction(prototype, "toPrecision",
1524 SimpleInstallFunction(prototype, "toString",
1526 SimpleInstallFunction(prototype, "valueOf",
1530 SimpleInstallFunction(prototype, "toLocaleString",
1570 Handle<JSValue> prototype =
1572 prototype->set_value(isolate->heap()->false_value());
1573 Accessors::FunctionSetPrototype(boolean_fun, prototype).Assert();
1575 // Install the "constructor" property on the {prototype}.
1576 JSObject::AddProperty(prototype, factory->constructor_string(), boolean_fun,
1579 // Install the Boolean.prototype methods.
1580 SimpleInstallFunction(prototype, "toString",
1582 SimpleInstallFunction(prototype, "valueOf",
1622 Handle<JSValue> prototype =
1624 prototype->set_value(isolate->heap()->empty_string());
1625 Accessors::FunctionSetPrototype(string_fun, prototype).Assert();
1627 // Install the "constructor" property on the {prototype}.
1628 JSObject::AddProperty(prototype, factory->constructor_string(), string_fun,
1631 // Install the String.prototype methods.
1632 SimpleInstallFunction(prototype, "charAt", Builtins::kStringPrototypeCharAt,
1634 SimpleInstallFunction(prototype, "charCodeAt",
1636 SimpleInstallFunction(prototype, "endsWith",
1638 SimpleInstallFunction(prototype, "includes",
1640 SimpleInstallFunction(prototype, "indexOf",
1642 SimpleInstallFunction(prototype, "lastIndexOf",
1644 SimpleInstallFunction(prototype, "localeCompare",
1646 SimpleInstallFunction(prototype, "normalize",
1648 SimpleInstallFunction(prototype, "replace",
1650 SimpleInstallFunction(prototype, "split", Builtins::kStringPrototypeSplit,
1652 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr,
1654 SimpleInstallFunction(prototype, "substring",
1656 SimpleInstallFunction(prototype, "startsWith",
1658 SimpleInstallFunction(prototype, "toString",
1660 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0,
1662 SimpleInstallFunction(prototype, "trimLeft",
1664 SimpleInstallFunction(prototype, "trimRight",
1666 SimpleInstallFunction(prototype, "toLocaleLowerCase",
1669 SimpleInstallFunction(prototype, "toLocaleUpperCase",
1672 SimpleInstallFunction(prototype, "toLowerCase",
1674 SimpleInstallFunction(prototype, "toUpperCase",
1676 SimpleInstallFunction(prototype, "valueOf",
1683 JSObject::AddProperty(prototype, factory->iterator_symbol(), iterator,
1724 Handle<JSObject> prototype =
1728 prototype, Builtins::kSymbolConstructor);
1759 // Install the @@toStringTag property on the {prototype}.
1761 prototype, factory->to_string_tag_symbol(),
1765 // Install the "constructor" property on the {prototype}.
1766 JSObject::AddProperty(prototype, factory->constructor_string(), symbol_fun,
1769 // Install the Symbol.prototype methods.
1770 SimpleInstallFunction(prototype, "toString",
1772 SimpleInstallFunction(prototype, "valueOf",
1777 prototype, factory->to_primitive_symbol(), JS_OBJECT_TYPE,
1790 prototype.
1791 Handle<JSObject> prototype =
1794 InstallFunction(global, "Date", JS_DATE_TYPE, JSDate::kSize, prototype,
1808 // Install the "constructor" property on the {prototype}.
1809 JSObject::AddProperty(prototype, factory->constructor_string(), date_fun,
1812 // Install the Date.prototype methods.
1813 SimpleInstallFunction(prototype, "toString",
1815 SimpleInstallFunction(prototype, "toDateString",
1817 SimpleInstallFunction(prototype, "toTimeString",
1819 SimpleInstallFunction(prototype, "toISOString",
1822 SimpleInstallFunction(prototype, "toUTCString",
1824 InstallFunction(prototype, to_utc_string,
1826 SimpleInstallFunction(prototype, "getDate", Builtins::kDatePrototypeGetDate,
1828 SimpleInstallFunction(prototype, "setDate", Builtins::kDatePrototypeSetDate,
1830 SimpleInstallFunction(prototype, "getDay", Builtins::kDatePrototypeGetDay,
1832 SimpleInstallFunction(prototype, "getFullYear",
1834 SimpleInstallFunction(prototype, "setFullYear",
1836 SimpleInstallFunction(prototype, "getHours",
1838 SimpleInstallFunction(prototype, "setHours",
1840 SimpleInstallFunction(prototype, "getMilliseconds",
1842 SimpleInstallFunction(prototype, "setMilliseconds",
1844 SimpleInstallFunction(prototype, "getMinutes",
1846 SimpleInstallFunction(prototype, "setMinutes",
1848 SimpleInstallFunction(prototype, "getMonth",
1850 SimpleInstallFunction(prototype, "setMonth",
1852 SimpleInstallFunction(prototype, "getSeconds",
1854 SimpleInstallFunction(prototype, "setSeconds",
1856 SimpleInstallFunction(prototype, "getTime", Builtins::kDatePrototypeGetTime,
1858 SimpleInstallFunction(prototype, "setTime", Builtins::kDatePrototypeSetTime,
1860 SimpleInstallFunction(prototype, "getTimezoneOffset",
1862 SimpleInstallFunction(prototype, "getUTCDate",
1864 SimpleInstallFunction(prototype, "setUTCDate",
1866 SimpleInstallFunction(prototype, "getUTCDay",
1868 SimpleInstallFunction(prototype, "getUTCFullYear",
1870 SimpleInstallFunction(prototype, "setUTCFullYear",
1872 SimpleInstallFunction(prototype, "getUTCHours",
1874 SimpleInstallFunction(prototype, "setUTCHours",
1876 SimpleInstallFunction(prototype, "getUTCMilliseconds",
1878 SimpleInstallFunction(prototype, "setUTCMilliseconds",
1880 SimpleInstallFunction(prototype, "getUTCMinutes",
1882 SimpleInstallFunction(prototype, "setUTCMinutes",
1884 SimpleInstallFunction(prototype, "getUTCMonth",
1886 SimpleInstallFunction(prototype, "setUTCMonth",
1888 SimpleInstallFunction(prototype, "getUTCSeconds",
1890 SimpleInstallFunction(prototype, "setUTCSeconds",
1892 SimpleInstallFunction(prototype, "valueOf", Builtins::kDatePrototypeValueOf,
1894 SimpleInstallFunction(prototype, "getYear", Builtins::kDatePrototypeGetYear,
1896 SimpleInstallFunction(prototype, "setYear", Builtins::kDatePrototypeSetYear,
1898 SimpleInstallFunction(prototype, "toJSON", Builtins::kDatePrototypeToJson,
1902 SimpleInstallFunction(prototype, "toLocaleString",
1904 SimpleInstallFunction(prototype, "toLocaleDateString",
1906 SimpleInstallFunction(prototype, "toLocaleTimeString",
1911 prototype, factory->to_primitive_symbol(), JS_OBJECT_TYPE,
1946 Handle<JSObject> prototype =
1950 prototype, Builtins::kPromiseConstructor);
1960 // Install the "constructor" property on the {prototype}.
1961 JSObject::AddProperty(prototype, factory->constructor_string(), promise_fun,
1964 // Install the @@toStringTag property on the {prototype}.
1966 prototype, factory->to_string_tag_symbol(), factory->Promise_string(),
1970 SimpleInstallFunction(prototype, isolate->factory()->then_string(),
1976 prototype, "catch", Builtins::kPromiseCatch, 1, true, DONT_ENUM);
1988 Handle<Map> prototype_map(prototype->map());
1991 // Store the initial Promise.prototype map. This is used in fast-path
1992 // checks. Do not alter the prototype after this point.
2073 // Builtin functions for RegExp.prototype.
2074 Handle<JSObject> prototype =
2078 prototype, Builtins::kRegExpConstructor);
2089 // RegExp.prototype setup.
2091 // Install the "constructor" property on the {prototype}.
2092 JSObject::AddProperty(prototype, factory->constructor_string(),
2097 prototype, factory->exec_string(), Builtins::kRegExpPrototypeExec,
2102 SimpleInstallGetter(prototype, factory->flags_string(),
2104 SimpleInstallGetter(prototype, factory->global_string(),
2106 SimpleInstallGetter(prototype, factory->ignoreCase_string(),
2108 SimpleInstallGetter(prototype, factory->multiline_string(),
2110 SimpleInstallGetter(prototype, factory->source_string(),
2112 SimpleInstallGetter(prototype, factory->sticky_string(),
2114 SimpleInstallGetter(prototype
2117 SimpleInstallFunction(prototype, "compile",
2120 SimpleInstallFunction(prototype, factory->toString_string(),
2123 SimpleInstallFunction(prototype, "test", Builtins::kRegExpPrototypeTest,
2130 InstallFunction(prototype, fun, factory->match_symbol(), DONT_ENUM);
2137 InstallFunction(prototype, fun, factory->replace_symbol(), DONT_ENUM);
2144 InstallFunction(prototype, fun, factory->search_symbol(), DONT_ENUM);
2151 InstallFunction(prototype, fun, factory->split_symbol(), DONT_ENUM);
2154 Handle<Map> prototype_map(prototype->map());
2157 // Store the initial RegExp.prototype map. This is used in fast-path
2158 // checks. Do not alter the prototype after this point.
2429 // Install the @@toStringTag property on the {prototype}.
2446 // Install the @@toStringTag property on the {prototype}.
2463 // Install the @@toStringTag property on the {prototype}.
2478 // Install the @@toStringTag property on the {prototype}.
2505 Handle<JSObject> prototype =
2507 native_context()->set_typed_array_prototype(*prototype);
2511 JS_TYPED_ARRAY_TYPE, JSTypedArray::kSize, prototype,
2516 // Install the "constructor" property on the {prototype}.
2517 JSObject::AddProperty(prototype, factory->constructor_string(),
2522 // getters on the {prototype}.
2523 SimpleInstallGetter(prototype, factory->buffer_string(),
2525 SimpleInstallGetter(prototype, factory->byte_length_string(),
2528 SimpleInstallGetter(prototype, factory->byte_offset_string(),
2531 SimpleInstallGetter(prototype, factory->length_string(),
2535 // Install "keys", "values" and "entries" methods on the {prototype}.
2537 SimpleInstallFunction(prototype, factory->entries_string(),
2542 SimpleInstallFunction(prototype, factory->keys_string(),
2547 SimpleInstallFunction(prototype, factory->values_string(),
2550 JSObject::AddProperty(prototype, factory->iterator_symbol(), values,
2554 SimpleInstallFunction(prototype, "copyWithin",
2571 Handle<JSObject> prototype =
2575 JSDataView::kSizeWithInternalFields, prototype,
2584 // Install the @@toStringTag property on the {prototype}.
2586 prototype, factory->to_string_tag_symbol(),
2590 // Install the "constructor" property on the {prototype}.
2591 JSObject::AddProperty(prototype, factory->constructor_string(),
2595 // on the {prototype}.
2596 SimpleInstallGetter(prototype, factory->buffer_string(),
2599 SimpleInstallGetter(prototype, factory->byte_length_string(),
2602 SimpleInstallGetter(prototype, factory->byte_offset_string(),
2606 SimpleInstallFunction(prototype, "getInt8",
2608 SimpleInstallFunction(prototype, "setInt8",
2610 SimpleInstallFunction(prototype, "getUint8",
2612 SimpleInstallFunction(prototype, "setUint8",
2614 SimpleInstallFunction(prototype, "getInt16",
2616 SimpleInstallFunction(prototype, "setInt16",
2618 SimpleInstallFunction(prototype, "getUint16",
2620 SimpleInstallFunction(prototype, "setUint16",
2622 SimpleInstallFunction(prototype, "getInt32",
2624 SimpleInstallFunction(prototype, "setInt32",
2626 SimpleInstallFunction(prototype, "getUint32",
2628 SimpleInstallFunction(prototype, "setUint32",
2630 SimpleInstallFunction(prototype, "getFloat32",
2632 SimpleInstallFunction(prototype, "setFloat32",
2634 SimpleInstallFunction(prototype, "getFloat64",
2636 SimpleInstallFunction(prototype, "setFloat64",
2904 DCHECK_EQ(native_context()->object_function()->prototype(),
2961 Handle<JSObject> prototype =
2965 prototype, Builtins::kIllegal);
2972 CHECK(JSObject::SetPrototype(prototype, typed_array_prototype, false,
3173 if (strcmp("prototype", inner) == 0) {
3175 return Handle<JSObject>(JSObject::cast(function->prototype()));
3307 Handle<JSObject> prototype =
3309 Accessors::FunctionSetPrototype(script_fun, prototype).Assert();
3611 factory->NewStringFromAsciiChecked("prototype"),
3686 Handle<JSObject> prototype(JSObject::cast(constructor->instance_prototype()));
3687 SimpleInstallFunction(prototype, "finally", Builtins::kPromiseFinally, 1,
3690 // The promise prototype map has changed because we added a property
3691 // to prototype, so we update the saved map.
3692 Handle<Map> prototype_map(prototype->map());
3749 native_context()->intl_date_time_format_function()->prototype()));
3776 JSObject::cast(native_context()->string_function()->prototype()));
3817 // Setup the {prototype} with the given {name} for @@toStringTag.
3818 Handle<JSObject> prototype =
3820 JSObject::AddProperty(prototype, factory()->to_string_tag_symbol(),
3824 // Allocate the constructor with the given {prototype}.
3827 JSArrayBuffer::kSizeWithInternalFields, prototype,
3834 // Install the "constructor" property on the {prototype}.
3835 JSObject::AddProperty(prototype, factory()->constructor_string(),
3841 // Install the "byteLength" getter on the {prototype}.
3842 SimpleInstallGetter(prototype, factory()->byte_length_string(), call, false,
3854 // the public Array constructor, except that its prototype
3855 // doesn't inherit from Object.prototype.
3858 Handle<JSObject> prototype =
3861 InstallFunction(target, name, JS_ARRAY_TYPE, JSArray::kSize, prototype,
3872 JSFunction::SetInitialMap(array_function, initial_map, prototype);
3927 Handle<JSObject> prototype =
3929 Accessors::FunctionSetPrototype(opaque_reference_fun, prototype).Assert();
3967 DCHECK(JSObject::cast(object_function->initial_map()->prototype())
3970 HeapObject::cast(object_function->initial_map()->prototype())->map());
3985 JSObject::cast(string_function->initial_map()->prototype());
4035 // Install Array.prototype.concat
4038 Handle<JSObject> proto(JSObject::cast(array_constructor->prototype()));
4043 // Make sure that Array.prototype.concat appears to be compiled.
4052 // Install InternalArray.prototype.concat
4056 Handle<JSObject> proto(JSObject::cast(array_constructor->prototype()));
4061 // Make sure that InternalArray.prototype.concat appears to be compiled.
4167 // Find global.Array.prototype to inherit from.
4177 // Set prototype on map.
4593 JSArray::cast(native_context()->array_function()->prototype()));
4749 // Transfer the prototype (new map is needed).
4750 Handle<Object> proto(from->map()->prototype(), isolate());
4756 // The maps with writable prototype are created in CreateEmptyFunction
4758 // created with read-only prototype for JS builtins processing.
4762 // Replace function instance maps to make prototype writable.
4912 // Store String.prototype's map again in case it has been changed by
4916 JSObject::cast(string_function->initial_map()->prototype());
5005 // Configure the hidden prototype chain of the global proxy.