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

Unified Diff: src/factory.cc

Issue 259173003: Kiss goodbye to MaybeObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase + addressed comments Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/execution.cc ('k') | src/gdb-jit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index fb1d6e7beaf44b50e3e785ce5f57a7aa2e566c15..7fc2a303439a51fc5114424b79d8a8df1da92021 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1069,10 +1069,12 @@ Handle<Object> Factory::NewNumberFromInt(int32_t value,
Handle<Object> Factory::NewNumberFromUint(uint32_t value,
- PretenureFlag pretenure) {
- CALL_HEAP_FUNCTION(
- isolate(),
- isolate()->heap()->NumberFromUint32(value, pretenure), Object);
+ PretenureFlag pretenure) {
+ int32_t int32v = static_cast<int32_t>(value);
+ if (int32v >= 0 && Smi::IsValid(int32v)) {
+ return handle(Smi::FromInt(int32v), isolate());
+ }
+ return NewHeapNumber(FastUI2D(value), pretenure);
}
@@ -1416,9 +1418,7 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
code->CopyFrom(desc);
#ifdef VERIFY_HEAP
- if (FLAG_verify_heap) {
- code->Verify();
- }
+ if (FLAG_verify_heap) code->ObjectVerify();
#endif
return code;
}
« no previous file with comments | « src/execution.cc ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698