| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 11701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11712 { | 11712 { |
| 11713 // If the object is not a value return the object. | 11713 // If the object is not a value return the object. |
| 11714 Push(object); | 11714 Push(object); |
| 11715 Add<HSimulate>(call->id(), FIXED_SIMULATE); | 11715 Add<HSimulate>(call->id(), FIXED_SIMULATE); |
| 11716 } | 11716 } |
| 11717 if_objectisvalue.End(); | 11717 if_objectisvalue.End(); |
| 11718 return ast_context()->ReturnValue(Pop()); | 11718 return ast_context()->ReturnValue(Pop()); |
| 11719 } | 11719 } |
| 11720 | 11720 |
| 11721 | 11721 |
| 11722 void HOptimizedGraphBuilder::GenerateJSValueGetValue(CallRuntime* call) { |
| 11723 DCHECK(call->arguments()->length() == 1); |
| 11724 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11725 HValue* value = Pop(); |
| 11726 HInstruction* result = Add<HLoadNamedField>( |
| 11727 value, nullptr, |
| 11728 HObjectAccess::ForObservableJSObjectOffset(JSValue::kValueOffset)); |
| 11729 return ast_context()->ReturnInstruction(result, call->id()); |
| 11730 } |
| 11731 |
| 11732 |
| 11722 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { | 11733 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { |
| 11723 DCHECK(call->arguments()->length() == 2); | 11734 DCHECK(call->arguments()->length() == 2); |
| 11724 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral()); | 11735 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral()); |
| 11725 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); | 11736 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); |
| 11726 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11737 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11727 HValue* date = Pop(); | 11738 HValue* date = Pop(); |
| 11728 HDateField* result = New<HDateField>(date, index); | 11739 HDateField* result = New<HDateField>(date, index); |
| 11729 return ast_context()->ReturnInstruction(result, call->id()); | 11740 return ast_context()->ReturnInstruction(result, call->id()); |
| 11730 } | 11741 } |
| 11731 | 11742 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11873 // Fast support for StringCompare. | 11884 // Fast support for StringCompare. |
| 11874 void HOptimizedGraphBuilder::GenerateStringCompare(CallRuntime* call) { | 11885 void HOptimizedGraphBuilder::GenerateStringCompare(CallRuntime* call) { |
| 11875 DCHECK_EQ(2, call->arguments()->length()); | 11886 DCHECK_EQ(2, call->arguments()->length()); |
| 11876 CHECK_ALIVE(VisitExpressions(call->arguments())); | 11887 CHECK_ALIVE(VisitExpressions(call->arguments())); |
| 11877 PushArgumentsFromEnvironment(call->arguments()->length()); | 11888 PushArgumentsFromEnvironment(call->arguments()->length()); |
| 11878 HCallStub* result = New<HCallStub>(CodeStub::StringCompare, 2); | 11889 HCallStub* result = New<HCallStub>(CodeStub::StringCompare, 2); |
| 11879 return ast_context()->ReturnInstruction(result, call->id()); | 11890 return ast_context()->ReturnInstruction(result, call->id()); |
| 11880 } | 11891 } |
| 11881 | 11892 |
| 11882 | 11893 |
| 11894 void HOptimizedGraphBuilder::GenerateStringGetLength(CallRuntime* call) { |
| 11895 DCHECK(call->arguments()->length() == 1); |
| 11896 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11897 HValue* string = Pop(); |
| 11898 HInstruction* result = AddLoadStringLength(string); |
| 11899 return ast_context()->ReturnInstruction(result, call->id()); |
| 11900 } |
| 11901 |
| 11902 |
| 11883 // Support for direct calls from JavaScript to native RegExp code. | 11903 // Support for direct calls from JavaScript to native RegExp code. |
| 11884 void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { | 11904 void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { |
| 11885 DCHECK_EQ(4, call->arguments()->length()); | 11905 DCHECK_EQ(4, call->arguments()->length()); |
| 11886 CHECK_ALIVE(VisitExpressions(call->arguments())); | 11906 CHECK_ALIVE(VisitExpressions(call->arguments())); |
| 11887 PushArgumentsFromEnvironment(call->arguments()->length()); | 11907 PushArgumentsFromEnvironment(call->arguments()->length()); |
| 11888 HCallStub* result = New<HCallStub>(CodeStub::RegExpExec, 4); | 11908 HCallStub* result = New<HCallStub>(CodeStub::RegExpExec, 4); |
| 11889 return ast_context()->ReturnInstruction(result, call->id()); | 11909 return ast_context()->ReturnInstruction(result, call->id()); |
| 11890 } | 11910 } |
| 11891 | 11911 |
| 11892 | 11912 |
| (...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13390 if (ShouldProduceTraceOutput()) { | 13410 if (ShouldProduceTraceOutput()) { |
| 13391 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13411 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13392 } | 13412 } |
| 13393 | 13413 |
| 13394 #ifdef DEBUG | 13414 #ifdef DEBUG |
| 13395 graph_->Verify(false); // No full verify. | 13415 graph_->Verify(false); // No full verify. |
| 13396 #endif | 13416 #endif |
| 13397 } | 13417 } |
| 13398 | 13418 |
| 13399 } } // namespace v8::internal | 13419 } } // namespace v8::internal |
| OLD | NEW |