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

Unified Diff: src/runtime.cc

Issue 274463003: Directly create API functions with readonly prototypes rather than converting. Remove FunctionSetRe… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove test Created 6 years, 7 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.h ('k') | test/mjsunit/runtime-gen/functionsetreadonlyprototype.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 49826069a5e0bce2800b801a282190f305a2433d..3e8167a68250b58b43d9864dcb4e4e96b0faebe0 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -3042,49 +3042,6 @@ RUNTIME_FUNCTION(Runtime_FunctionSetPrototype) {
}
-RUNTIME_FUNCTION(Runtime_FunctionSetReadOnlyPrototype) {
- HandleScope shs(isolate);
- RUNTIME_ASSERT(args.length() == 1);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
-
- Handle<String> name = isolate->factory()->prototype_string();
-
- if (function->HasFastProperties()) {
- // Construct a new field descriptor with updated attributes.
- Handle<DescriptorArray> instance_desc =
- handle(function->map()->instance_descriptors());
-
- int index = instance_desc->SearchWithCache(*name, function->map());
- ASSERT(index != DescriptorArray::kNotFound);
- PropertyDetails details = instance_desc->GetDetails(index);
-
- CallbacksDescriptor new_desc(
- name,
- handle(instance_desc->GetValue(index), isolate),
- static_cast<PropertyAttributes>(details.attributes() | READ_ONLY));
-
- // Create a new map featuring the new field descriptors array.
- Handle<Map> map = handle(function->map());
- Handle<Map> new_map = Map::CopyReplaceDescriptor(
- map, instance_desc, &new_desc, index, OMIT_TRANSITION);
-
- JSObject::MigrateToMap(function, new_map);
- } else { // Dictionary properties.
- // Directly manipulate the property details.
- DisallowHeapAllocation no_gc;
- int entry = function->property_dictionary()->FindEntry(name);
- ASSERT(entry != NameDictionary::kNotFound);
- PropertyDetails details = function->property_dictionary()->DetailsAt(entry);
- PropertyDetails new_details(
- static_cast<PropertyAttributes>(details.attributes() | READ_ONLY),
- details.type(),
- details.dictionary_index());
- function->property_dictionary()->DetailsAtPut(entry, new_details);
- }
- return *function;
-}
-
-
RUNTIME_FUNCTION(Runtime_FunctionIsAPIFunction) {
SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/runtime-gen/functionsetreadonlyprototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698