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

Unified Diff: src/hydrogen.cc

Issue 993963002: Converted Crankshaft to have its own list of known intrinsics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed undef 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/hydrogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 1c1375b06b8d84b4f55b6b92169ec3112e265e97..545031b7185648fcaa5b0e7798c89788f31792f6 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9524,38 +9524,6 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
}
-// Support for generating inlined runtime functions.
-
-// Lookup table for generators for runtime calls that are generated inline.
-// Elements of the table are member pointers to functions of
-// HOptimizedGraphBuilder.
-#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize) \
- &HOptimizedGraphBuilder::Generate##Name,
-
-const HOptimizedGraphBuilder::InlineFunctionGenerator
- HOptimizedGraphBuilder::kInlineFunctionGenerators[] = {
- INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
- INLINE_OPTIMIZED_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
-};
-#undef INLINE_FUNCTION_GENERATOR_ADDRESS
-
-
-HOptimizedGraphBuilder::InlineFunctionGenerator
-HOptimizedGraphBuilder::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) return nullptr;
- int lookup_index =
- static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction);
- DCHECK(static_cast<size_t>(lookup_index) <
- arraysize(kInlineFunctionGenerators));
- return kInlineFunctionGenerators[lookup_index];
-}
-
-
template <class ViewClass>
void HGraphBuilder::BuildArrayBufferViewInitialization(
HValue* obj,
@@ -9934,21 +9902,21 @@ void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* expr) {
const Runtime::Function* function = expr->function();
DCHECK(function != NULL);
-
- InlineFunctionGenerator generator = FindInlineFunctionGenerator(expr);
- if (generator != nullptr) {
- DCHECK(expr->name()->length() > 0);
- DCHECK(expr->name()->Get(0) == '_');
- // Call the inline code generator using the pointer-to-member.
- (this->*generator)(expr);
- } else {
- Handle<String> name = expr->name();
- int argument_count = expr->arguments()->length();
- CHECK_ALIVE(VisitExpressions(expr->arguments()));
- PushArgumentsFromEnvironment(argument_count);
- HCallRuntime* call = New<HCallRuntime>(name, function,
- argument_count);
- return ast_context()->ReturnInstruction(call, expr->id());
+ switch (function->function_id) {
+#define CALL_INTRINSIC_GENERATOR(Name) \
+ case Runtime::kInline##Name: \
+ return Generate##Name(expr);
+
+ FOR_EACH_HYDROGEN_INTRINSIC(CALL_INTRINSIC_GENERATOR)
+#undef CALL_INTRINSIC_GENERATOR
+ default: {
+ Handle<String> name = expr->name();
+ int argument_count = expr->arguments()->length();
+ CHECK_ALIVE(VisitExpressions(expr->arguments()));
+ PushArgumentsFromEnvironment(argument_count);
+ HCallRuntime* call = New<HCallRuntime>(name, function, argument_count);
+ return ast_context()->ReturnInstruction(call, expr->id());
+ }
}
}
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698