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

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

Issue 1744163002: [stubs] Introduce a proper ToBooleanStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips Created 4 years, 9 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/code-stubs.cc ('k') | src/compiler/code-stub-assembler.h » ('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 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 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 } 1674 }
1675 1675
1676 return BuildStringAdd(left, right, HAllocationMode(pretenure_flag)); 1676 return BuildStringAdd(left, right, HAllocationMode(pretenure_flag));
1677 } 1677 }
1678 1678
1679 1679
1680 Handle<Code> StringAddStub::GenerateCode() { 1680 Handle<Code> StringAddStub::GenerateCode() {
1681 return DoGenerateCode(this); 1681 return DoGenerateCode(this);
1682 } 1682 }
1683 1683
1684
1685 template <> 1684 template <>
1686 HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() { 1685 HValue* CodeStubGraphBuilder<ToBooleanICStub>::BuildCodeInitializedStub() {
1687 ToBooleanStub* stub = casted_stub(); 1686 ToBooleanICStub* stub = casted_stub();
1688 IfBuilder if_true(this); 1687 IfBuilder if_true(this);
1689 if_true.If<HBranch>(GetParameter(0), stub->types()); 1688 if_true.If<HBranch>(GetParameter(0), stub->types());
1690 if_true.Then(); 1689 if_true.Then();
1691 if_true.Return(graph()->GetConstantTrue()); 1690 if_true.Return(graph()->GetConstantTrue());
1692 if_true.Else(); 1691 if_true.Else();
1693 if_true.End(); 1692 if_true.End();
1694 return graph()->GetConstantFalse(); 1693 return graph()->GetConstantFalse();
1695 } 1694 }
1696 1695
1697 1696 Handle<Code> ToBooleanICStub::GenerateCode() { return DoGenerateCode(this); }
1698 Handle<Code> ToBooleanStub::GenerateCode() {
1699 return DoGenerateCode(this);
1700 }
1701
1702 1697
1703 template <> 1698 template <>
1704 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() { 1699 HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() {
1705 StoreGlobalStub* stub = casted_stub(); 1700 StoreGlobalStub* stub = casted_stub();
1706 HParameter* value = GetParameter(StoreDescriptor::kValueIndex); 1701 HParameter* value = GetParameter(StoreDescriptor::kValueIndex);
1707 if (stub->check_global()) { 1702 if (stub->check_global()) {
1708 // Check that the map of the global has not changed: use a placeholder map 1703 // Check that the map of the global has not changed: use a placeholder map
1709 // that will be replaced later with the global object's map. 1704 // that will be replaced later with the global object's map.
1710 HParameter* proxy = GetParameter(StoreDescriptor::kReceiverIndex); 1705 HParameter* proxy = GetParameter(StoreDescriptor::kReceiverIndex);
1711 HValue* proxy_map = 1706 HValue* proxy_map =
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2399 return Pop(); 2394 return Pop();
2400 } 2395 }
2401 2396
2402 2397
2403 Handle<Code> KeyedLoadGenericStub::GenerateCode() { 2398 Handle<Code> KeyedLoadGenericStub::GenerateCode() {
2404 return DoGenerateCode(this); 2399 return DoGenerateCode(this);
2405 } 2400 }
2406 2401
2407 } // namespace internal 2402 } // namespace internal
2408 } // namespace v8 2403 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698