| 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 11910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11921 DCHECK(call->arguments()->length() == 1); | 11921 DCHECK(call->arguments()->length() == 1); |
| 11922 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11922 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11923 HValue* value = Pop(); | 11923 HValue* value = Pop(); |
| 11924 HInstruction* result = Add<HLoadNamedField>( | 11924 HInstruction* result = Add<HLoadNamedField>( |
| 11925 value, nullptr, | 11925 value, nullptr, |
| 11926 HObjectAccess::ForObservableJSObjectOffset(JSValue::kValueOffset)); | 11926 HObjectAccess::ForObservableJSObjectOffset(JSValue::kValueOffset)); |
| 11927 return ast_context()->ReturnInstruction(result, call->id()); | 11927 return ast_context()->ReturnInstruction(result, call->id()); |
| 11928 } | 11928 } |
| 11929 | 11929 |
| 11930 | 11930 |
| 11931 void HOptimizedGraphBuilder::GenerateThrowIfNotADate(CallRuntime* call) { |
| 11932 DCHECK_EQ(1, call->arguments()->length()); |
| 11933 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11934 HValue* obj = Pop(); |
| 11935 BuildCheckHeapObject(obj); |
| 11936 HCheckInstanceType* check = |
| 11937 New<HCheckInstanceType>(obj, HCheckInstanceType::IS_JS_DATE); |
| 11938 return ast_context()->ReturnInstruction(check, call->id()); |
| 11939 } |
| 11940 |
| 11941 |
| 11931 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { | 11942 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { |
| 11932 DCHECK(call->arguments()->length() == 2); | 11943 DCHECK(call->arguments()->length() == 2); |
| 11933 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral()); | 11944 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral()); |
| 11934 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); | 11945 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); |
| 11935 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11946 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11936 HValue* date = Pop(); | 11947 HValue* date = Pop(); |
| 11937 HDateField* result = New<HDateField>(date, index); | 11948 HDateField* result = New<HDateField>(date, index); |
| 11938 return ast_context()->ReturnInstruction(result, call->id()); | 11949 return ast_context()->ReturnInstruction(result, call->id()); |
| 11939 } | 11950 } |
| 11940 | 11951 |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13156 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13167 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13157 } | 13168 } |
| 13158 | 13169 |
| 13159 #ifdef DEBUG | 13170 #ifdef DEBUG |
| 13160 graph_->Verify(false); // No full verify. | 13171 graph_->Verify(false); // No full verify. |
| 13161 #endif | 13172 #endif |
| 13162 } | 13173 } |
| 13163 | 13174 |
| 13164 } // namespace internal | 13175 } // namespace internal |
| 13165 } // namespace v8 | 13176 } // namespace v8 |
| OLD | NEW |