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

Unified Diff: src/bootstrapper.cc

Issue 246693005: Convert function.prototype to API-style accessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Check that exception is never thrown Created 6 years, 8 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/accessors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 6c6e6b361150707da995ca6d9fe7e52f122d198b..5bfc3b708913b16eae915b6988b7f193862f7fe4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -392,10 +392,6 @@ void Genesis::SetFunctionInstanceDescriptor(
Handle<Foreign> name(factory()->NewForeign(&Accessors::FunctionName));
Handle<Foreign> args(factory()->NewForeign(&Accessors::FunctionArguments));
Handle<Foreign> caller(factory()->NewForeign(&Accessors::FunctionCaller));
- Handle<Foreign> prototype;
- if (prototypeMode != DONT_ADD_PROTOTYPE) {
- prototype = factory()->NewForeign(&Accessors::FunctionPrototype);
- }
PropertyAttributes attribs = static_cast<PropertyAttributes>(
DONT_ENUM | DONT_DELETE | READ_ONLY);
@@ -416,11 +412,13 @@ void Genesis::SetFunctionInstanceDescriptor(
map->AppendDescriptor(&d);
}
if (prototypeMode != DONT_ADD_PROTOTYPE) {
- // Add prototype.
if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) {
attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY);
}
- CallbacksDescriptor d(factory()->prototype_string(), prototype, attribs);
+ Handle<AccessorInfo> prototype =
+ Accessors::FunctionPrototypeInfo(isolate(), attribs);
+ CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())),
+ prototype, attribs);
map->AppendDescriptor(&d);
}
}
@@ -523,10 +521,6 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
Handle<Foreign> name(factory()->NewForeign(&Accessors::FunctionName));
Handle<AccessorPair> arguments(factory()->NewAccessorPair());
Handle<AccessorPair> caller(factory()->NewAccessorPair());
- Handle<Foreign> prototype;
- if (prototypeMode != DONT_ADD_PROTOTYPE) {
- prototype = factory()->NewForeign(&Accessors::FunctionPrototype);
- }
PropertyAttributes rw_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
PropertyAttributes ro_attribs =
@@ -553,7 +547,10 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
// Add prototype.
PropertyAttributes attribs =
prototypeMode == ADD_WRITEABLE_PROTOTYPE ? rw_attribs : ro_attribs;
- CallbacksDescriptor d(factory()->prototype_string(), prototype, attribs);
+ Handle<AccessorInfo> prototype =
+ Accessors::FunctionPrototypeInfo(isolate(), attribs);
+ CallbacksDescriptor d(Handle<Name>(Name::cast(prototype->name())),
+ prototype, attribs);
map->AppendDescriptor(&d);
}
}
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698