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

Side by Side Diff: runtime/vm/intrinsifier.cc

Issue 22866025: Always generate full unoptimized code for intrinsified methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_arm.cc » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Class for intrinsifying functions. 4 // Class for intrinsifying functions.
5 5
6 #include "vm/intrinsifier.h" 6 #include "vm/intrinsifier.h"
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION); 134 MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
135 135
136 // Set up all dart:typed_data lib functions that can be intrisified. 136 // Set up all dart:typed_data lib functions that can be intrisified.
137 lib = Library::TypedDataLibrary(); 137 lib = Library::TypedDataLibrary();
138 TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION); 138 TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
139 139
140 #undef SETUP_FUNCTION 140 #undef SETUP_FUNCTION
141 } 141 }
142 142
143 143
144 bool Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) { 144 void Intrinsifier::Intrinsify(const Function& function, Assembler* assembler) {
145 if (!CanIntrinsify(function)) return false; 145 if (!CanIntrinsify(function)) return;
146 146
147 const char* function_name = String::Handle(function.name()).ToCString(); 147 const char* function_name = String::Handle(function.name()).ToCString();
148 const Class& function_class = Class::Handle(function.Owner()); 148 const Class& function_class = Class::Handle(function.Owner());
149 const char* class_name = String::Handle(function_class.Name()).ToCString(); 149 const char* class_name = String::Handle(function_class.Name()).ToCString();
150 const Library& lib = Library::Handle(function_class.library()); 150 const Library& lib = Library::Handle(function_class.library());
151 151
152 #define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \ 152 #define FIND_INTRINSICS(test_class_name, test_function_name, destination, fp) \
153 if (TestFunction(lib, function, \ 153 if (TestFunction(lib, function, \
154 class_name, function_name, \ 154 class_name, function_name, \
155 #test_class_name, #test_function_name)) { \ 155 #test_class_name, #test_function_name)) { \
156 ASSERT(function.CheckSourceFingerprint(fp)); \ 156 ASSERT(function.CheckSourceFingerprint(fp)); \
157 return destination(assembler); \ 157 return destination(assembler); \
158 } \ 158 } \
159 159
160 if (lib.raw() == Library::CoreLibrary()) { 160 if (lib.raw() == Library::CoreLibrary()) {
161 CORE_LIB_INTRINSIC_LIST(FIND_INTRINSICS); 161 CORE_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
162 if (!FLAG_throw_on_javascript_int_overflow || (Smi::kBits < 32)) { 162 if (!FLAG_throw_on_javascript_int_overflow || (Smi::kBits < 32)) {
163 CORE_INTEGER_LIB_INTRINSIC_LIST(FIND_INTRINSICS); 163 CORE_INTEGER_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
164 } 164 }
165 } else if (lib.raw() == Library::TypedDataLibrary()) { 165 } else if (lib.raw() == Library::TypedDataLibrary()) {
166 TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS); 166 TYPED_DATA_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
167 } else if (lib.raw() == Library::MathLibrary()) { 167 } else if (lib.raw() == Library::MathLibrary()) {
168 MATH_LIB_INTRINSIC_LIST(FIND_INTRINSICS); 168 MATH_LIB_INTRINSIC_LIST(FIND_INTRINSICS);
169 } 169 }
170 return false;
171
172 #undef FIND_INTRINSICS 170 #undef FIND_INTRINSICS
173 } 171 }
174 172
175 } // namespace dart 173 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier.h ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698