OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 Handle<Code> ToNumberStub::GenerateCode(Isolate* isolate) { | 335 Handle<Code> ToNumberStub::GenerateCode(Isolate* isolate) { |
336 return DoGenerateCode(isolate, this); | 336 return DoGenerateCode(isolate, this); |
337 } | 337 } |
338 | 338 |
339 | 339 |
340 template <> | 340 template <> |
341 HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() { | 341 HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() { |
342 info()->MarkAsSavesCallerDoubles(); | 342 info()->MarkAsSavesCallerDoubles(); |
343 HValue* number = GetParameter(NumberToStringStub::kNumber); | 343 HValue* number = GetParameter(NumberToStringStub::kNumber); |
344 return BuildNumberToString(number, handle(Type::Number(), isolate())); | 344 return BuildNumberToString(number, Type::Number(isolate())); |
345 } | 345 } |
346 | 346 |
347 | 347 |
348 Handle<Code> NumberToStringStub::GenerateCode(Isolate* isolate) { | 348 Handle<Code> NumberToStringStub::GenerateCode(Isolate* isolate) { |
349 return DoGenerateCode(isolate, this); | 349 return DoGenerateCode(isolate, this); |
350 } | 350 } |
351 | 351 |
352 | 352 |
353 template <> | 353 template <> |
354 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { | 354 HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() { |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 !left_type->Is(Type::String()) && !right_type->Is(Type::String())) { | 915 !left_type->Is(Type::String()) && !right_type->Is(Type::String())) { |
916 // For the generic add stub a fast case for string addition is performance | 916 // For the generic add stub a fast case for string addition is performance |
917 // critical. | 917 // critical. |
918 if (left_type->Maybe(Type::String())) { | 918 if (left_type->Maybe(Type::String())) { |
919 IfBuilder if_leftisstring(this); | 919 IfBuilder if_leftisstring(this); |
920 if_leftisstring.If<HIsStringAndBranch>(left); | 920 if_leftisstring.If<HIsStringAndBranch>(left); |
921 if_leftisstring.Then(); | 921 if_leftisstring.Then(); |
922 { | 922 { |
923 Push(BuildBinaryOperation( | 923 Push(BuildBinaryOperation( |
924 state.op(), left, right, | 924 state.op(), left, right, |
925 handle(Type::String(), isolate()), right_type, | 925 Type::String(isolate()), right_type, |
926 result_type, state.fixed_right_arg())); | 926 result_type, state.fixed_right_arg())); |
927 } | 927 } |
928 if_leftisstring.Else(); | 928 if_leftisstring.Else(); |
929 { | 929 { |
930 Push(BuildBinaryOperation( | 930 Push(BuildBinaryOperation( |
931 state.op(), left, right, | 931 state.op(), left, right, |
932 left_type, right_type, result_type, | 932 left_type, right_type, result_type, |
933 state.fixed_right_arg())); | 933 state.fixed_right_arg())); |
934 } | 934 } |
935 if_leftisstring.End(); | 935 if_leftisstring.End(); |
936 result = Pop(); | 936 result = Pop(); |
937 } else { | 937 } else { |
938 IfBuilder if_rightisstring(this); | 938 IfBuilder if_rightisstring(this); |
939 if_rightisstring.If<HIsStringAndBranch>(right); | 939 if_rightisstring.If<HIsStringAndBranch>(right); |
940 if_rightisstring.Then(); | 940 if_rightisstring.Then(); |
941 { | 941 { |
942 Push(BuildBinaryOperation( | 942 Push(BuildBinaryOperation( |
943 state.op(), left, right, | 943 state.op(), left, right, |
944 left_type, handle(Type::String(), isolate()), | 944 left_type, Type::String(isolate()), |
945 result_type, state.fixed_right_arg())); | 945 result_type, state.fixed_right_arg())); |
946 } | 946 } |
947 if_rightisstring.Else(); | 947 if_rightisstring.Else(); |
948 { | 948 { |
949 Push(BuildBinaryOperation( | 949 Push(BuildBinaryOperation( |
950 state.op(), left, right, | 950 state.op(), left, right, |
951 left_type, right_type, result_type, | 951 left_type, right_type, result_type, |
952 state.fixed_right_arg())); | 952 state.fixed_right_arg())); |
953 } | 953 } |
954 if_rightisstring.End(); | 954 if_rightisstring.End(); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 return BuildUncheckedDictionaryElementLoad(receiver, key); | 1331 return BuildUncheckedDictionaryElementLoad(receiver, key); |
1332 } | 1332 } |
1333 | 1333 |
1334 | 1334 |
1335 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { | 1335 Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) { |
1336 return DoGenerateCode(isolate, this); | 1336 return DoGenerateCode(isolate, this); |
1337 } | 1337 } |
1338 | 1338 |
1339 | 1339 |
1340 } } // namespace v8::internal | 1340 } } // namespace v8::internal |
OLD | NEW |