Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: src/hydrogen.cc

Issue 1191283003: [date] Use explicit control flow to replace %_ThrowIfNotADate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 11940 matching lines...) Expand 10 before | Expand all | Expand 10 after
11951 DCHECK(call->arguments()->length() == 1); 11951 DCHECK(call->arguments()->length() == 1);
11952 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 11952 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11953 HValue* value = Pop(); 11953 HValue* value = Pop();
11954 HInstruction* result = Add<HLoadNamedField>( 11954 HInstruction* result = Add<HLoadNamedField>(
11955 value, nullptr, 11955 value, nullptr,
11956 HObjectAccess::ForObservableJSObjectOffset(JSValue::kValueOffset)); 11956 HObjectAccess::ForObservableJSObjectOffset(JSValue::kValueOffset));
11957 return ast_context()->ReturnInstruction(result, call->id()); 11957 return ast_context()->ReturnInstruction(result, call->id());
11958 } 11958 }
11959 11959
11960 11960
11961 void HOptimizedGraphBuilder::GenerateThrowIfNotADate(CallRuntime* call) { 11961 void HOptimizedGraphBuilder::GenerateIsDate(CallRuntime* call) {
11962 DCHECK_EQ(1, call->arguments()->length()); 11962 DCHECK_EQ(1, call->arguments()->length());
11963 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 11963 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11964 HValue* obj = Pop(); 11964 HValue* value = Pop();
11965 BuildCheckHeapObject(obj); 11965 HHasInstanceTypeAndBranch* result =
11966 HCheckInstanceType* check = 11966 New<HHasInstanceTypeAndBranch>(value, JS_DATE_TYPE);
11967 New<HCheckInstanceType>(obj, HCheckInstanceType::IS_JS_DATE); 11967 return ast_context()->ReturnControl(result, call->id());
11968 return ast_context()->ReturnInstruction(check, call->id());
11969 } 11968 }
11970 11969
11971 11970
11971 void HOptimizedGraphBuilder::GenerateThrowNotDateError(CallRuntime* call) {
11972 DCHECK_EQ(0, call->arguments()->length());
11973 Add<HDeoptimize>(Deoptimizer::kNotADateObject, Deoptimizer::EAGER);
11974 Add<HSimulate>(call->id(), FIXED_SIMULATE);
11975 return ast_context()->ReturnValue(graph()->GetConstantUndefined());
11976 }
11977
11978
11972 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { 11979 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) {
11973 DCHECK(call->arguments()->length() == 2); 11980 DCHECK(call->arguments()->length() == 2);
11974 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral()); 11981 DCHECK_NOT_NULL(call->arguments()->at(1)->AsLiteral());
11975 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); 11982 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value()));
11976 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 11983 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11977 HValue* date = Pop(); 11984 HValue* date = Pop();
11978 HDateField* result = New<HDateField>(date, index); 11985 HDateField* result = New<HDateField>(date, index);
11979 return ast_context()->ReturnInstruction(result, call->id()); 11986 return ast_context()->ReturnInstruction(result, call->id());
11980 } 11987 }
11981 11988
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
13197 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13204 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13198 } 13205 }
13199 13206
13200 #ifdef DEBUG 13207 #ifdef DEBUG
13201 graph_->Verify(false); // No full verify. 13208 graph_->Verify(false); // No full verify.
13202 #endif 13209 #endif
13203 } 13210 }
13204 13211
13205 } // namespace internal 13212 } // namespace internal
13206 } // namespace v8 13213 } // namespace v8
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698