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

Side by Side Diff: src/messages.js

Issue 150018: Optimize %IsConstructCall() on IA-32. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 %FunctionSetPrototype(ErrorPrototype, $Object.prototype); 652 %FunctionSetPrototype(ErrorPrototype, $Object.prototype);
653 %FunctionSetInstanceClassName(ErrorPrototype, 'Error'); 653 %FunctionSetInstanceClassName(ErrorPrototype, 'Error');
654 %FunctionSetPrototype(f, new ErrorPrototype()); 654 %FunctionSetPrototype(f, new ErrorPrototype());
655 } else { 655 } else {
656 %FunctionSetPrototype(f, new $Error()); 656 %FunctionSetPrototype(f, new $Error());
657 } 657 }
658 %FunctionSetInstanceClassName(f, 'Error'); 658 %FunctionSetInstanceClassName(f, 'Error');
659 %SetProperty(f.prototype, 'constructor', f, DONT_ENUM); 659 %SetProperty(f.prototype, 'constructor', f, DONT_ENUM);
660 f.prototype.name = name; 660 f.prototype.name = name;
661 %SetCode(f, function(m) { 661 %SetCode(f, function(m) {
662 if (%IsConstructCall()) { 662 if (%_IsConstructCall()) {
663 if (m === kAddMessageAccessorsMarker) { 663 if (m === kAddMessageAccessorsMarker) {
664 DefineOneShotAccessor(this, 'message', function (obj) { 664 DefineOneShotAccessor(this, 'message', function (obj) {
665 return FormatMessage({type: obj.type, args: obj.arguments}); 665 return FormatMessage({type: obj.type, args: obj.arguments});
666 }); 666 });
667 } else if (!IS_UNDEFINED(m)) { 667 } else if (!IS_UNDEFINED(m)) {
668 this.message = ToString(m); 668 this.message = ToString(m);
669 } 669 }
670 } else { 670 } else {
671 return new f(m); 671 return new f(m);
672 } 672 }
(...skipping 19 matching lines...) Expand all
692 return this.name + ": " + FormatMessage({ type: type, args: this.arguments } ); 692 return this.name + ": " + FormatMessage({ type: type, args: this.arguments } );
693 } 693 }
694 var message = this.message; 694 var message = this.message;
695 return this.name + (message ? (": " + message) : ""); 695 return this.name + (message ? (": " + message) : "");
696 }, DONT_ENUM); 696 }, DONT_ENUM);
697 697
698 698
699 // Boilerplate for exceptions for stack overflows. Used from 699 // Boilerplate for exceptions for stack overflows. Used from
700 // Top::StackOverflow(). 700 // Top::StackOverflow().
701 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); 701 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []);
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/regexp-delay.js » ('j') | src/x64/codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698