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

Side by Side Diff: src/v8natives.js

Issue 1292283004: Do not use js builtins object to determine whether a function is a builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove redundant check Created 5 years, 4 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
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 1615
1616 function FunctionSourceString(func) { 1616 function FunctionSourceString(func) {
1617 while (%IsJSFunctionProxy(func)) { 1617 while (%IsJSFunctionProxy(func)) {
1618 func = %GetCallTrap(func); 1618 func = %GetCallTrap(func);
1619 } 1619 }
1620 1620
1621 if (!IS_FUNCTION(func)) { 1621 if (!IS_FUNCTION(func)) {
1622 throw MakeTypeError(kNotGeneric, 'Function.prototype.toString'); 1622 throw MakeTypeError(kNotGeneric, 'Function.prototype.toString');
1623 } 1623 }
1624 1624
1625 if (%FunctionIsBuiltin(func)) { 1625 if (%FunctionHidesSource(func)) {
1626 return NativeCodeFunctionSourceString(func); 1626 return NativeCodeFunctionSourceString(func);
1627 } 1627 }
1628 1628
1629 var classSource = %ClassGetSourceCode(func); 1629 var classSource = %ClassGetSourceCode(func);
1630 if (IS_STRING(classSource)) { 1630 if (IS_STRING(classSource)) {
1631 return classSource; 1631 return classSource;
1632 } 1632 }
1633 1633
1634 var source = %FunctionGetSourceCode(func); 1634 var source = %FunctionGetSourceCode(func);
1635 if (!IS_STRING(source)) { 1635 if (!IS_STRING(source)) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 }); 1810 });
1811 1811
1812 utils.ExportToRuntime(function(to) { 1812 utils.ExportToRuntime(function(to) {
1813 to.GlobalEval = GlobalEval; 1813 to.GlobalEval = GlobalEval;
1814 to.ObjectDefineOwnProperty = DefineOwnPropertyFromAPI; 1814 to.ObjectDefineOwnProperty = DefineOwnPropertyFromAPI;
1815 to.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor; 1815 to.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;
1816 to.ToCompletePropertyDescriptor = ToCompletePropertyDescriptor; 1816 to.ToCompletePropertyDescriptor = ToCompletePropertyDescriptor;
1817 }); 1817 });
1818 1818
1819 }) 1819 })
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698