| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 &CodeGenerator::Generate##Name, | 354 &CodeGenerator::Generate##Name, |
| 355 | 355 |
| 356 const CodeGenerator::InlineFunctionGenerator | 356 const CodeGenerator::InlineFunctionGenerator |
| 357 CodeGenerator::kInlineFunctionGenerators[] = { | 357 CodeGenerator::kInlineFunctionGenerators[] = { |
| 358 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS) | 358 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS) |
| 359 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS) | 359 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS) |
| 360 }; | 360 }; |
| 361 #undef INLINE_FUNCTION_GENERATOR_ADDRESS | 361 #undef INLINE_FUNCTION_GENERATOR_ADDRESS |
| 362 | 362 |
| 363 | 363 |
| 364 CodeGenerator::InlineFunctionGenerator | |
| 365 CodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) { | |
| 366 return kInlineFunctionGenerators[ | |
| 367 static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction)]; | |
| 368 } | |
| 369 | |
| 370 | |
| 371 bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) { | 364 bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) { |
| 372 ZoneList<Expression*>* args = node->arguments(); | 365 ZoneList<Expression*>* args = node->arguments(); |
| 373 Handle<String> name = node->name(); | 366 Handle<String> name = node->name(); |
| 374 Runtime::Function* function = node->function(); | 367 Runtime::Function* function = node->function(); |
| 375 if (function != NULL && function->intrinsic_type == Runtime::INLINE) { | 368 if (function != NULL && function->intrinsic_type == Runtime::INLINE) { |
| 376 InlineFunctionGenerator generator = | 369 int lookup_index = static_cast<int>(function->function_id) - |
| 377 FindInlineFunctionGenerator(function->function_id); | 370 static_cast<int>(Runtime::kFirstInlineFunction); |
| 378 if (generator != NULL) { | 371 ASSERT(lookup_index >= 0); |
| 379 ((*this).*(generator))(args); | 372 ASSERT(static_cast<size_t>(lookup_index) < |
| 380 return true; | 373 ARRAY_SIZE(kInlineFunctionGenerators)); |
| 381 } | 374 InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index]; |
| 375 (this->*generator)(args); |
| 376 return true; |
| 382 } | 377 } |
| 383 return false; | 378 return false; |
| 384 } | 379 } |
| 385 | 380 |
| 386 | 381 |
| 387 // Simple condition analysis. ALWAYS_TRUE and ALWAYS_FALSE represent a | 382 // Simple condition analysis. ALWAYS_TRUE and ALWAYS_FALSE represent a |
| 388 // known result for the test expression, with no side effects. | 383 // known result for the test expression, with no side effects. |
| 389 CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition( | 384 CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition( |
| 390 Expression* cond) { | 385 Expression* cond) { |
| 391 if (cond == NULL) return ALWAYS_TRUE; | 386 if (cond == NULL) return ALWAYS_TRUE; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 } | 491 } |
| 497 } | 492 } |
| 498 | 493 |
| 499 | 494 |
| 500 void ApiGetterEntryStub::SetCustomCache(Code* value) { | 495 void ApiGetterEntryStub::SetCustomCache(Code* value) { |
| 501 info()->set_load_stub_cache(value); | 496 info()->set_load_stub_cache(value); |
| 502 } | 497 } |
| 503 | 498 |
| 504 | 499 |
| 505 } } // namespace v8::internal | 500 } } // namespace v8::internal |
| OLD | NEW |