OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 9080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9091 HValue* context = environment()->LookupContext(); | 9091 HValue* context = environment()->LookupContext(); |
9092 HGlobalObject* global_object = Add<HGlobalObject>(context); | 9092 HGlobalObject* global_object = Add<HGlobalObject>(context); |
9093 HRandom* result = new(zone()) HRandom(global_object); | 9093 HRandom* result = new(zone()) HRandom(global_object); |
9094 return ast_context()->ReturnInstruction(result, call->id()); | 9094 return ast_context()->ReturnInstruction(result, call->id()); |
9095 } | 9095 } |
9096 | 9096 |
9097 | 9097 |
9098 // Fast support for StringAdd. | 9098 // Fast support for StringAdd. |
9099 void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) { | 9099 void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) { |
9100 ASSERT_EQ(2, call->arguments()->length()); | 9100 ASSERT_EQ(2, call->arguments()->length()); |
9101 CHECK_ALIVE(VisitArgumentList(call->arguments())); | 9101 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 9102 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
| 9103 HValue* right = Pop(); |
| 9104 HValue* left = Pop(); |
9102 HValue* context = environment()->LookupContext(); | 9105 HValue* context = environment()->LookupContext(); |
9103 HCallStub* result = new(zone()) HCallStub(context, CodeStub::StringAdd, 2); | 9106 HInstruction* result = HStringAdd::New( |
9104 Drop(2); | 9107 zone(), context, left, right, NO_STRING_ADD_FLAGS); |
9105 return ast_context()->ReturnInstruction(result, call->id()); | 9108 return ast_context()->ReturnInstruction(result, call->id()); |
9106 } | 9109 } |
9107 | 9110 |
9108 | 9111 |
9109 // Fast support for SubString. | 9112 // Fast support for SubString. |
9110 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { | 9113 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { |
9111 ASSERT_EQ(3, call->arguments()->length()); | 9114 ASSERT_EQ(3, call->arguments()->length()); |
9112 CHECK_ALIVE(VisitArgumentList(call->arguments())); | 9115 CHECK_ALIVE(VisitArgumentList(call->arguments())); |
9113 HValue* context = environment()->LookupContext(); | 9116 HValue* context = environment()->LookupContext(); |
9114 HCallStub* result = new(zone()) HCallStub(context, CodeStub::SubString, 3); | 9117 HCallStub* result = new(zone()) HCallStub(context, CodeStub::SubString, 3); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9930 if (ShouldProduceTraceOutput()) { | 9933 if (ShouldProduceTraceOutput()) { |
9931 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9934 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
9932 } | 9935 } |
9933 | 9936 |
9934 #ifdef DEBUG | 9937 #ifdef DEBUG |
9935 graph_->Verify(false); // No full verify. | 9938 graph_->Verify(false); // No full verify. |
9936 #endif | 9939 #endif |
9937 } | 9940 } |
9938 | 9941 |
9939 } } // namespace v8::internal | 9942 } } // namespace v8::internal |
OLD | NEW |