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

Side by Side Diff: test/cctest/test-heap.cc

Issue 11644097: Use C++ style type casts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 12 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 | Annotate | Revision Log
« src/arm/simulator-arm.cc ('K') | « src/utils.h ('k') | no next file » | 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 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "compilation-cache.h" 7 #include "compilation-cache.h"
8 #include "execution.h" 8 #include "execution.h"
9 #include "factory.h" 9 #include "factory.h"
10 #include "macro-assembler.h" 10 #include "macro-assembler.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 #endif 157 #endif
158 158
159 MaybeObject* maybe_value = 159 MaybeObject* maybe_value =
160 HEAP->NumberFromUint32(static_cast<uint32_t>(Smi::kMaxValue) + 1); 160 HEAP->NumberFromUint32(static_cast<uint32_t>(Smi::kMaxValue) + 1);
161 value = maybe_value->ToObjectChecked(); 161 value = maybe_value->ToObjectChecked();
162 CHECK(value->IsHeapNumber()); 162 CHECK(value->IsHeapNumber());
163 CHECK(value->IsNumber()); 163 CHECK(value->IsNumber());
164 CHECK_EQ(static_cast<double>(static_cast<uint32_t>(Smi::kMaxValue) + 1), 164 CHECK_EQ(static_cast<double>(static_cast<uint32_t>(Smi::kMaxValue) + 1),
165 value->Number()); 165 value->Number());
166 166
167 maybe_value =
168 HEAP->NumberFromUint32(static_cast<uint32_t>(1) << 31);
Michael Starzinger 2013/01/07 14:36:31 Should fit into one line.
169 value = maybe_value->ToObjectChecked();
170 CHECK(value->IsHeapNumber());
171 CHECK(value->IsNumber());
172 CHECK_EQ(static_cast<double>(static_cast<uint32_t>(1) << 31),
173 value->Number());
174
167 // nan oddball checks 175 // nan oddball checks
168 CHECK(HEAP->nan_value()->IsNumber()); 176 CHECK(HEAP->nan_value()->IsNumber());
169 CHECK(isnan(HEAP->nan_value()->Number())); 177 CHECK(isnan(HEAP->nan_value()->Number()));
170 178
171 Handle<String> s = FACTORY->NewStringFromAscii(CStrVector("fisk hest ")); 179 Handle<String> s = FACTORY->NewStringFromAscii(CStrVector("fisk hest "));
172 CHECK(s->IsString()); 180 CHECK(s->IsString());
173 CHECK_EQ(10, s->length()); 181 CHECK_EQ(10, s->length());
174 182
175 String* object_symbol = String::cast(HEAP->Object_symbol()); 183 String* object_symbol = String::cast(HEAP->Object_symbol());
176 CHECK( 184 CHECK(
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2609 2617
2610 // Simulate incremental marking so that unoptimized code is flushed 2618 // Simulate incremental marking so that unoptimized code is flushed
2611 // even though it still is cached in the optimized code map. 2619 // even though it still is cached in the optimized code map.
2612 SimulateIncrementalMarking(); 2620 SimulateIncrementalMarking();
2613 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 2621 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
2614 2622
2615 // Make a new closure that will get code installed from the code map. 2623 // Make a new closure that will get code installed from the code map.
2616 // Unoptimized code is missing and the deoptimizer will go ballistic. 2624 // Unoptimized code is missing and the deoptimizer will go ballistic.
2617 CompileRun("var g = mkClosure(); g('bozo');"); 2625 CompileRun("var g = mkClosure(); g('bozo');");
2618 } 2626 }
OLDNEW
« src/arm/simulator-arm.cc ('K') | « src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698