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

Side by Side Diff: src/templates.js

Issue 1306993003: Call JS functions via native context instead of js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 3 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-scopes.cc ('k') | src/v8natives.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 // Called from a desugaring in the parser. 5 // Called from a desugaring in the parser.
6 6
7 var $getTemplateCallSite;
8
9 (function(global, utils) { 7 (function(global, utils) {
10 8
11 "use strict"; 9 "use strict";
12 10
13 %CheckIsBootstrapping(); 11 %CheckIsBootstrapping();
14 12
15 // ------------------------------------------------------------------- 13 // -------------------------------------------------------------------
16 // Imports 14 // Imports
17 15
18 var GlobalMap = global.Map; 16 var GlobalMap = global.Map;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 array[0] = siteObj; 58 array[0] = siteObj;
61 %_CallFunction(callSiteCache, hash, array, mapSetFn); 59 %_CallFunction(callSiteCache, hash, array, mapSetFn);
62 } else { 60 } else {
63 obj.push(siteObj); 61 obj.push(siteObj);
64 } 62 }
65 63
66 return siteObj; 64 return siteObj;
67 } 65 }
68 66
69 67
70 $getTemplateCallSite = function(siteObj, rawStrings, hash) { 68 function GetTemplateCallSite(siteObj, rawStrings, hash) {
71 var cached = GetCachedCallSite(rawStrings, hash); 69 var cached = GetCachedCallSite(rawStrings, hash);
72 70
73 if (!IS_UNDEFINED(cached)) return cached; 71 if (!IS_UNDEFINED(cached)) return cached;
74 72
75 %AddNamedProperty(siteObj, "raw", %ObjectFreeze(rawStrings), 73 %AddNamedProperty(siteObj, "raw", %ObjectFreeze(rawStrings),
76 READ_ONLY | DONT_ENUM | DONT_DELETE); 74 READ_ONLY | DONT_ENUM | DONT_DELETE);
77 75
78 return SetCachedCallSite(%ObjectFreeze(siteObj), hash); 76 return SetCachedCallSite(%ObjectFreeze(siteObj), hash);
79 } 77 }
80 78
79 // ----------------------------------------------------------------------------
80 // Exports
81
82 %InstallToContext(["get_template_call_site", GetTemplateCallSite]);
83
81 }) 84 })
OLDNEW
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698