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

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, 11 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
« no previous file with comments | « 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 = HEAP->NumberFromUint32(static_cast<uint32_t>(1) << 31);
168 value = maybe_value->ToObjectChecked();
169 CHECK(value->IsHeapNumber());
170 CHECK(value->IsNumber());
171 CHECK_EQ(static_cast<double>(static_cast<uint32_t>(1) << 31),
172 value->Number());
173
167 // nan oddball checks 174 // nan oddball checks
168 CHECK(HEAP->nan_value()->IsNumber()); 175 CHECK(HEAP->nan_value()->IsNumber());
169 CHECK(isnan(HEAP->nan_value()->Number())); 176 CHECK(isnan(HEAP->nan_value()->Number()));
170 177
171 Handle<String> s = FACTORY->NewStringFromAscii(CStrVector("fisk hest ")); 178 Handle<String> s = FACTORY->NewStringFromAscii(CStrVector("fisk hest "));
172 CHECK(s->IsString()); 179 CHECK(s->IsString());
173 CHECK_EQ(10, s->length()); 180 CHECK_EQ(10, s->length());
174 181
175 String* object_symbol = String::cast(HEAP->Object_symbol()); 182 String* object_symbol = String::cast(HEAP->Object_symbol());
176 CHECK( 183 CHECK(
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 2620
2614 // Simulate incremental marking so that unoptimized code is flushed 2621 // Simulate incremental marking so that unoptimized code is flushed
2615 // even though it still is cached in the optimized code map. 2622 // even though it still is cached in the optimized code map.
2616 SimulateIncrementalMarking(); 2623 SimulateIncrementalMarking();
2617 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 2624 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
2618 2625
2619 // Make a new closure that will get code installed from the code map. 2626 // Make a new closure that will get code installed from the code map.
2620 // Unoptimized code is missing and the deoptimizer will go ballistic. 2627 // Unoptimized code is missing and the deoptimizer will go ballistic.
2621 CompileRun("var g = mkClosure(); g('bozo');"); 2628 CompileRun("var g = mkClosure(); g('bozo');");
2622 } 2629 }
OLDNEW
« no previous file with comments | « src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698