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

Unified Diff: src/full-codegen.cc

Issue 978123003: Merged INLINE_OPTIMIZED intrinsic type into INLINE. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed feedback. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 6f2317cf102959db039ac79054b23e39999d527f..8721bcd9a69be4989e27775a9a0759979393dff7 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -895,22 +895,23 @@ const FullCodeGenerator::InlineFunctionGenerator
FullCodeGenerator::InlineFunctionGenerator
- FullCodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) {
- int lookup_index =
- static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction);
- DCHECK(lookup_index >= 0);
- DCHECK(static_cast<size_t>(lookup_index) <
- arraysize(kInlineFunctionGenerators));
- return kInlineFunctionGenerators[lookup_index];
+FullCodeGenerator::FindInlineFunctionGenerator(CallRuntime* expr) {
+ const Runtime::Function* function = expr->function();
+ if (function == nullptr || function->intrinsic_type != Runtime::INLINE) {
+ return nullptr;
+ }
+ Runtime::FunctionId id = function->function_id;
+ if (id < Runtime::kFirstInlineFunction || Runtime::kLastInlineFunction < id) {
+ return nullptr;
+ }
+ return kInlineFunctionGenerators[static_cast<int>(id) -
+ static_cast<int>(
+ Runtime::kFirstInlineFunction)];
}
-void FullCodeGenerator::EmitInlineRuntimeCall(CallRuntime* expr) {
- const Runtime::Function* function = expr->function();
- DCHECK(function != NULL);
- DCHECK(function->intrinsic_type == Runtime::INLINE);
- InlineFunctionGenerator generator =
- FindInlineFunctionGenerator(function->function_id);
+void FullCodeGenerator::EmitInlineRuntimeCall(
+ CallRuntime* expr, InlineFunctionGenerator generator) {
((*this).*(generator))(expr);
}
« no previous file with comments | « src/full-codegen.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698