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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 1417503008: [turbofan] Use CompareNilIC for abstract equality with null/undefined. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/crankshaft/hydrogen.h" 8 #include "src/crankshaft/hydrogen.h"
9 #include "src/crankshaft/lithium.h" 9 #include "src/crankshaft/lithium.h"
10 #include "src/field-index.h" 10 #include "src/field-index.h"
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 Isolate* isolate = graph()->isolate(); 1349 Isolate* isolate = graph()->isolate();
1350 CompareNilICStub* stub = casted_stub(); 1350 CompareNilICStub* stub = casted_stub();
1351 HIfContinuation continuation; 1351 HIfContinuation continuation;
1352 Handle<Map> sentinel_map(isolate->heap()->meta_map()); 1352 Handle<Map> sentinel_map(isolate->heap()->meta_map());
1353 Type* type = stub->GetType(zone(), sentinel_map); 1353 Type* type = stub->GetType(zone(), sentinel_map);
1354 BuildCompareNil(GetParameter(0), type, &continuation, kEmbedMapsViaWeakCells); 1354 BuildCompareNil(GetParameter(0), type, &continuation, kEmbedMapsViaWeakCells);
1355 IfBuilder if_nil(this, &continuation); 1355 IfBuilder if_nil(this, &continuation);
1356 if_nil.Then(); 1356 if_nil.Then();
1357 if (continuation.IsFalseReachable()) { 1357 if (continuation.IsFalseReachable()) {
1358 if_nil.Else(); 1358 if_nil.Else();
1359 if_nil.Return(graph()->GetConstant0()); 1359 if_nil.Return(graph()->GetConstantFalse());
1360 } 1360 }
1361 if_nil.End(); 1361 if_nil.End();
1362 return continuation.IsTrueReachable() 1362 return continuation.IsTrueReachable() ? graph()->GetConstantTrue()
1363 ? graph()->GetConstant1() 1363 : graph()->GetConstantUndefined();
1364 : graph()->GetConstantUndefined();
1365 } 1364 }
1366 1365
1367 1366
1368 Handle<Code> CompareNilICStub::GenerateCode() { 1367 Handle<Code> CompareNilICStub::GenerateCode() {
1369 return DoGenerateCode(this); 1368 return DoGenerateCode(this);
1370 } 1369 }
1371 1370
1372 1371
1373 template <> 1372 template <>
1374 HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() { 1373 HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 return Pop(); 2364 return Pop();
2366 } 2365 }
2367 2366
2368 2367
2369 Handle<Code> KeyedLoadGenericStub::GenerateCode() { 2368 Handle<Code> KeyedLoadGenericStub::GenerateCode() {
2370 return DoGenerateCode(this); 2369 return DoGenerateCode(this);
2371 } 2370 }
2372 2371
2373 } // namespace internal 2372 } // namespace internal
2374 } // namespace v8 2373 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698