Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index c6c9ed2ae4fd4f74a87e523380cae83adcda5dee..3761f308bbb8ceb0480c4af3a07e5cc6d52f4d02 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -1565,7 +1565,6 @@ void HGraphBuilder::BuildKeyedIndexCheck(HValue* key, |
| internalized.Else(); |
| Add<HPushArguments>(key); |
| HValue* intern_key = Add<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(Runtime::kInternalizeString), 1); |
| Push(intern_key); |
| @@ -1723,7 +1722,6 @@ HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad( |
| // TODO(jkummerow): walk the prototype chain instead. |
| Add<HPushArguments>(receiver, key); |
| Push(Add<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(is_strong(language_mode) |
| ? Runtime::kKeyedGetPropertyStrong |
| : Runtime::kKeyedGetProperty), |
| @@ -1786,7 +1784,6 @@ HValue* HGraphBuilder::BuildUncheckedDictionaryElementLoad( |
| details_compare.Else(); |
| Add<HPushArguments>(receiver, key); |
| Push(Add<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(is_strong(language_mode) |
| ? Runtime::kKeyedGetPropertyStrong |
| : Runtime::kKeyedGetProperty), |
| @@ -2020,7 +2017,6 @@ HValue* HGraphBuilder::BuildNumberToString(HValue* object, Type* type) { |
| // Cache miss, fallback to runtime. |
| Add<HPushArguments>(object); |
| Push(Add<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(Runtime::kNumberToStringSkipCache), |
| 1)); |
| } |
| @@ -2436,8 +2432,7 @@ HValue* HGraphBuilder::BuildUncheckedStringAdd( |
| { |
| // Fallback to the runtime to add the two strings. |
| Add<HPushArguments>(left, right); |
| - Push(Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(Runtime::kStringAdd), 2)); |
| + Push(Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kStringAdd), 2)); |
| } |
| if_sameencodingandsequential.End(); |
| } |
| @@ -5299,8 +5294,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt, |
| map = graph()->GetConstant1(); |
| Runtime::FunctionId function_id = Runtime::kGetPropertyNamesFast; |
| Add<HPushArguments>(enumerable); |
| - array = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(function_id), 1); |
| + array = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 1); |
| Push(array); |
| Add<HSimulate>(stmt->EnumId()); |
| Drop(1); |
| @@ -5355,8 +5349,7 @@ void HOptimizedGraphBuilder::BuildForInBody(ForInStatement* stmt, |
| } else { |
| Add<HPushArguments>(enumerable, key); |
| Runtime::FunctionId function_id = Runtime::kForInFilter; |
| - key = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(function_id), 2); |
| + key = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 2); |
| Push(key); |
| Add<HSimulate>(stmt->FilterId()); |
| key = Pop(); |
| @@ -5840,9 +5833,7 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
| Add<HConstant>(flags)); |
| Runtime::FunctionId function_id = Runtime::kCreateObjectLiteral; |
| - literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(function_id), |
| - 4); |
| + literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); |
| } |
| // The object is expected in the bailout environment during computation |
| @@ -6011,9 +6002,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| Add<HConstant>(flags)); |
| Runtime::FunctionId function_id = Runtime::kCreateArrayLiteral; |
| - literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(function_id), |
| - 4); |
| + literal = Add<HCallRuntime>(Runtime::FunctionForId(function_id), 4); |
| // Register to deopt if the boilerplate ElementsKind changes. |
| top_info()->dependencies()->AssumeTransitionStable(site); |
| @@ -6502,7 +6491,6 @@ HValue* HOptimizedGraphBuilder::BuildMonomorphicAccess( |
| DCHECK(info->IsLoad()); |
| if (is_strong(function_language_mode())) { |
| return New<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(Runtime::kThrowStrongModeImplicitConversion), |
| 0); |
| } else { |
| @@ -7158,8 +7146,7 @@ void HOptimizedGraphBuilder::VisitThrow(Throw* expr) { |
| HValue* value = environment()->Pop(); |
| if (!top_info()->is_tracking_positions()) SetSourcePosition(expr->position()); |
| Add<HPushArguments>(value); |
| - Add<HCallRuntime>(isolate()->factory()->empty_string(), |
| - Runtime::FunctionForId(Runtime::kThrow), 1); |
| + Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kThrow), 1); |
| Add<HSimulate>(expr->id()); |
| // If the throw definitely exits the function, we can finish with a dummy |
| @@ -10284,7 +10271,7 @@ void HOptimizedGraphBuilder::GenerateTypedArrayInitialize( |
| Push(byte_length); |
| CHECK_ALIVE(VisitForValue(arguments->at(kInitializeArg))); |
| PushArgumentsFromEnvironment(kArgsLength); |
| - Add<HCallRuntime>(expr->name(), expr->function(), kArgsLength); |
| + Add<HCallRuntime>(expr->function(), kArgsLength); |
| } |
| } |
| byte_offset_smi.End(); |
| @@ -10375,11 +10362,10 @@ void HOptimizedGraphBuilder::VisitCallRuntime(CallRuntime* 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); |
| + HCallRuntime* call = New<HCallRuntime>(function, argument_count); |
| return ast_context()->ReturnInstruction(call, expr->id()); |
| } |
| } |
| @@ -10410,7 +10396,6 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { |
| HValue* obj = Pop(); |
| Add<HPushArguments>(obj, key); |
| HInstruction* instr = New<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(is_strict(function_language_mode()) |
| ? Runtime::kDeleteProperty_Strict |
| : Runtime::kDeleteProperty_Sloppy), |
| @@ -11017,7 +11002,6 @@ HValue* HGraphBuilder::BuildBinaryOperation( |
| if_builder.OrIf<HHasInstanceTypeAndBranch>(right, ODDBALL_TYPE); |
| if_builder.Then(); |
| Add<HCallRuntime>( |
| - isolate()->factory()->empty_string(), |
| Runtime::FunctionForId(Runtime::kThrowStrongModeImplicitConversion), |
| 0); |
| if (!graph()->info()->IsStub()) { |
| @@ -11115,9 +11099,7 @@ static bool IsClassOfTest(CompareOperation* expr) { |
| Literal* literal = expr->right()->AsLiteral(); |
| if (literal == NULL) return false; |
| if (!literal->value()->IsString()) return false; |
| - if (!call->name()->IsOneByteEqualTo(STATIC_CHAR_VECTOR("_ClassOf"))) { |
| - return false; |
| - } |
| + if (call->function()->function_id != Runtime::kInlineClassOf) return false; |
|
Michael Starzinger
2015/08/26 09:43:21
Is "call" guaranteed to point to a runtime functio
Yang
2015/08/26 10:27:30
Done.
|
| DCHECK(call->arguments()->length() == 1); |
| return true; |
| } |
| @@ -12794,8 +12776,8 @@ void HOptimizedGraphBuilder::GenerateGetPrototype(CallRuntime* call) { |
| needs_runtime.Then(); |
| { |
| Add<HPushArguments>(object); |
| - Push(Add<HCallRuntime>( |
| - call->name(), Runtime::FunctionForId(Runtime::kGetPrototype), 1)); |
| + Push( |
| + Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kGetPrototype), 1)); |
| } |
| needs_runtime.Else(); |