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

Side by Side Diff: src/crankshaft/hydrogen-instructions.cc

Issue 2087803004: Version 5.0.71.54 (cherry-pick) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 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 | « include/v8-version.h ('k') | test/mjsunit/regress/regress-opt-typeof-null.js » ('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/crankshaft/hydrogen-instructions.h" 5 #include "src/crankshaft/hydrogen-instructions.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/safe_math.h" 8 #include "src/base/safe_math.h"
9 #include "src/crankshaft/hydrogen-infer-representation.h" 9 #include "src/crankshaft/hydrogen-infer-representation.h"
10 #include "src/double.h" 10 #include "src/double.h"
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 os << NameOf(value()) << " == " << type_literal()->ToCString().get(); 1276 os << NameOf(value()) << " == " << type_literal()->ToCString().get();
1277 return HControlInstruction::PrintDataTo(os); 1277 return HControlInstruction::PrintDataTo(os);
1278 } 1278 }
1279 1279
1280 1280
1281 namespace { 1281 namespace {
1282 1282
1283 String* TypeOfString(HConstant* constant, Isolate* isolate) { 1283 String* TypeOfString(HConstant* constant, Isolate* isolate) {
1284 Heap* heap = isolate->heap(); 1284 Heap* heap = isolate->heap();
1285 if (constant->HasNumberValue()) return heap->number_string(); 1285 if (constant->HasNumberValue()) return heap->number_string();
1286 if (constant->IsUndetectable()) return heap->undefined_string();
1287 if (constant->HasStringValue()) return heap->string_string(); 1286 if (constant->HasStringValue()) return heap->string_string();
1288 switch (constant->GetInstanceType()) { 1287 switch (constant->GetInstanceType()) {
1289 case ODDBALL_TYPE: { 1288 case ODDBALL_TYPE: {
1290 Unique<Object> unique = constant->GetUnique(); 1289 Unique<Object> unique = constant->GetUnique();
1291 if (unique.IsKnownGlobal(heap->true_value()) || 1290 if (unique.IsKnownGlobal(heap->true_value()) ||
1292 unique.IsKnownGlobal(heap->false_value())) { 1291 unique.IsKnownGlobal(heap->false_value())) {
1293 return heap->boolean_string(); 1292 return heap->boolean_string();
1294 } 1293 }
1295 if (unique.IsKnownGlobal(heap->null_value())) { 1294 if (unique.IsKnownGlobal(heap->null_value())) {
1296 return heap->object_string(); 1295 return heap->object_string();
1297 } 1296 }
1298 DCHECK(unique.IsKnownGlobal(heap->undefined_value())); 1297 DCHECK(unique.IsKnownGlobal(heap->undefined_value()));
1299 return heap->undefined_string(); 1298 return heap->undefined_string();
1300 } 1299 }
1301 case SYMBOL_TYPE: 1300 case SYMBOL_TYPE:
1302 return heap->symbol_string(); 1301 return heap->symbol_string();
1303 case SIMD128_VALUE_TYPE: { 1302 case SIMD128_VALUE_TYPE: {
1304 Unique<Map> map = constant->ObjectMap(); 1303 Unique<Map> map = constant->ObjectMap();
1305 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 1304 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
1306 if (map.IsKnownGlobal(heap->type##_map())) { \ 1305 if (map.IsKnownGlobal(heap->type##_map())) { \
1307 return heap->type##_string(); \ 1306 return heap->type##_string(); \
1308 } 1307 }
1309 SIMD128_TYPES(SIMD128_TYPE) 1308 SIMD128_TYPES(SIMD128_TYPE)
1310 #undef SIMD128_TYPE 1309 #undef SIMD128_TYPE
1311 UNREACHABLE(); 1310 UNREACHABLE();
1312 return nullptr; 1311 return nullptr;
1313 } 1312 }
1314 default: 1313 default:
1314 if (constant->IsUndetectable()) return heap->undefined_string();
1315 if (constant->IsCallable()) return heap->function_string(); 1315 if (constant->IsCallable()) return heap->function_string();
1316 return heap->object_string(); 1316 return heap->object_string();
1317 } 1317 }
1318 } 1318 }
1319 1319
1320 } // namespace 1320 } // namespace
1321 1321
1322 1322
1323 bool HTypeofIsAndBranch::KnownSuccessorBlock(HBasicBlock** block) { 1323 bool HTypeofIsAndBranch::KnownSuccessorBlock(HBasicBlock** block) {
1324 if (FLAG_fold_constants && value()->IsConstant()) { 1324 if (FLAG_fold_constants && value()->IsConstant()) {
(...skipping 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 case HObjectAccess::kExternalMemory: 4643 case HObjectAccess::kExternalMemory:
4644 os << "[external-memory]"; 4644 os << "[external-memory]";
4645 break; 4645 break;
4646 } 4646 }
4647 4647
4648 return os << "@" << access.offset(); 4648 return os << "@" << access.offset();
4649 } 4649 }
4650 4650
4651 } // namespace internal 4651 } // namespace internal
4652 } // namespace v8 4652 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/regress/regress-opt-typeof-null.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698