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

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

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master 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 | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/hydrogen-types.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 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 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 } 2405 }
2406 2406
2407 2407
2408 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate, 2408 Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate,
2409 Zone* zone) { 2409 Zone* zone) {
2410 HConstant* res = NULL; 2410 HConstant* res = NULL;
2411 Handle<Object> handle = this->handle(isolate); 2411 Handle<Object> handle = this->handle(isolate);
2412 if (handle->IsBoolean()) { 2412 if (handle->IsBoolean()) {
2413 res = handle->BooleanValue() ? 2413 res = handle->BooleanValue() ?
2414 new(zone) HConstant(1) : new(zone) HConstant(0); 2414 new(zone) HConstant(1) : new(zone) HConstant(0);
2415 } else if (handle->IsUndefined()) { 2415 } else if (handle->IsUndefined(isolate)) {
2416 res = new (zone) HConstant(std::numeric_limits<double>::quiet_NaN()); 2416 res = new (zone) HConstant(std::numeric_limits<double>::quiet_NaN());
2417 } else if (handle->IsNull()) { 2417 } else if (handle->IsNull()) {
2418 res = new(zone) HConstant(0); 2418 res = new(zone) HConstant(0);
2419 } else if (handle->IsString()) { 2419 } else if (handle->IsString()) {
2420 res = new(zone) HConstant(String::ToNumber(Handle<String>::cast(handle))); 2420 res = new(zone) HConstant(String::ToNumber(Handle<String>::cast(handle)));
2421 } 2421 }
2422 return res != NULL ? Just(res) : Nothing<HConstant*>(); 2422 return res != NULL ? Just(res) : Nothing<HConstant*>();
2423 } 2423 }
2424 2424
2425 2425
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after
4026 case HObjectAccess::kExternalMemory: 4026 case HObjectAccess::kExternalMemory:
4027 os << "[external-memory]"; 4027 os << "[external-memory]";
4028 break; 4028 break;
4029 } 4029 }
4030 4030
4031 return os << "@" << access.offset(); 4031 return os << "@" << access.offset();
4032 } 4032 }
4033 4033
4034 } // namespace internal 4034 } // namespace internal
4035 } // namespace v8 4035 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/hydrogen-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698