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

Unified Diff: src/messages.js

Issue 384003003: Replace AddProperty by AddNamedProperty to speed up the common case (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/math.js ('k') | src/object-observe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 4f786b590fbca91513b4944117c2b467a2deba37..33fbaa5d80b8bb821fc39112bd747446d39f2ce1 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -285,8 +285,8 @@ function MakeGenericError(constructor, type, args) {
* Set up the Script function and constructor.
*/
%FunctionSetInstanceClassName(Script, 'Script');
-%AddProperty(Script.prototype, 'constructor', Script,
- DONT_ENUM | DONT_DELETE | READ_ONLY);
+%AddNamedProperty(Script.prototype, 'constructor', Script,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetCode(Script, function(x) {
// Script objects can only be created by the VM.
throw new $Error("Not supported");
@@ -1159,9 +1159,9 @@ function SetUpError() {
// effects when overwriting the error functions from
// user code.
var name = f.name;
- %AddProperty(global, name, f, DONT_ENUM);
- %AddProperty(builtins, '$' + name, f,
- DONT_ENUM | DONT_DELETE | READ_ONLY);
+ %AddNamedProperty(global, name, f, DONT_ENUM);
+ %AddNamedProperty(builtins, '$' + name, f,
+ DONT_ENUM | DONT_DELETE | READ_ONLY);
// Configure the error function.
if (name == 'Error') {
// The prototype of the Error object must itself be an error.
@@ -1176,16 +1176,16 @@ function SetUpError() {
%FunctionSetPrototype(f, new $Error());
}
%FunctionSetInstanceClassName(f, 'Error');
- %AddProperty(f.prototype, 'constructor', f, DONT_ENUM);
- %AddProperty(f.prototype, "name", name, DONT_ENUM);
+ %AddNamedProperty(f.prototype, 'constructor', f, DONT_ENUM);
+ %AddNamedProperty(f.prototype, "name", name, DONT_ENUM);
%SetCode(f, function(m) {
if (%_IsConstructCall()) {
// Define all the expected properties directly on the error
// object. This avoids going through getters and setters defined
// on prototype objects.
- %AddProperty(this, 'stack', UNDEFINED, DONT_ENUM);
+ %AddNamedProperty(this, 'stack', UNDEFINED, DONT_ENUM);
if (!IS_UNDEFINED(m)) {
- %AddProperty(this, 'message', ToString(m), DONT_ENUM);
+ %AddNamedProperty(this, 'message', ToString(m), DONT_ENUM);
}
try { captureStackTrace(this, f); } catch (e) { }
} else {
@@ -1208,7 +1208,7 @@ SetUpError();
$Error.captureStackTrace = captureStackTrace;
-%AddProperty($Error.prototype, 'message', '', DONT_ENUM);
+%AddNamedProperty($Error.prototype, 'message', '', DONT_ENUM);
// Global list of error objects visited during ErrorToString. This is
// used to detect cycles in error toString formatting.
« no previous file with comments | « src/math.js ('k') | src/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698