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

Side by Side Diff: runtime/lib/internal_patch.dart

Issue 2988613002: Compute the script Uri lazily (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:core' hide Symbol; 5 import 'dart:core' hide Symbol;
6 import 'dart:typed_data' show Int32List; 6 import 'dart:typed_data' show Int32List;
7 7
8 @patch 8 @patch
9 List makeListFixedLength(List growableList) 9 List makeListFixedLength(List growableList)
10 native "Internal_makeListFixedLength"; 10 native "Internal_makeListFixedLength";
(...skipping 16 matching lines...) Expand all
27 // Implementation of Resource.readAsBytes. 27 // Implementation of Resource.readAsBytes.
28 static var resourceReadAsBytes; 28 static var resourceReadAsBytes;
29 29
30 // Implementation of package root/map provision. 30 // Implementation of package root/map provision.
31 static var packageRootString; 31 static var packageRootString;
32 static var packageConfigString; 32 static var packageConfigString;
33 static var packageRootUriFuture; 33 static var packageRootUriFuture;
34 static var packageConfigUriFuture; 34 static var packageConfigUriFuture;
35 static var resolvePackageUriFuture; 35 static var resolvePackageUriFuture;
36 36
37 static var platformScript; 37 static var _computeScriptUri;
38 static var _cachedScript;
39 static set platformScript(var f) {
40 _computeScriptUri = f;
41 _cachedScript = null;
42 }
43
44 static get platformScript {
45 if (_cachedScript == null && _computeScriptUri != null) {
46 _cachedScript = _computeScriptUri();
47 }
48 return _cachedScript;
49 }
38 } 50 }
39 51
40 final bool is64Bit = _inquireIs64Bit(); 52 final bool is64Bit = _inquireIs64Bit();
41 53
42 bool _inquireIs64Bit() native "Internal_inquireIs64Bit"; 54 bool _inquireIs64Bit() native "Internal_inquireIs64Bit";
43 55
44 bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) { 56 bool _classRangeCheck(int cid, int lowerLimit, int upperLimit) {
45 return cid >= lowerLimit && cid <= upperLimit; 57 return cid >= lowerLimit && cid <= upperLimit;
46 } 58 }
47 59
(...skipping 25 matching lines...) Expand all
73 native "Internal_prependTypeArguments"; 85 native "Internal_prependTypeArguments";
74 86
75 // Called by IRRegExpMacroAssembler::GrowStack. 87 // Called by IRRegExpMacroAssembler::GrowStack.
76 Int32List _growRegExpStack(Int32List stack) { 88 Int32List _growRegExpStack(Int32List stack) {
77 final newStack = new Int32List(stack.length * 2); 89 final newStack = new Int32List(stack.length * 2);
78 for (int i = 0; i < stack.length; i++) { 90 for (int i = 0; i < stack.length; i++) {
79 newStack[i] = stack[i]; 91 newStack[i] = stack[i];
80 } 92 }
81 return newStack; 93 return newStack;
82 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698