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

Side by Side Diff: test/cctest/test-macro-assembler-mips.cc

Issue 1413463006: Map v8::Object to v8::internal::JSReceiver (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 1 month 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 | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-unboxed-doubles.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 static void TestNaN(const char *code) { 137 static void TestNaN(const char *code) {
138 // NaN value is different on MIPS and x86 architectures, and TEST(NaNx) 138 // NaN value is different on MIPS and x86 architectures, and TEST(NaNx)
139 // tests checks the case where a x86 NaN value is serialized into the 139 // tests checks the case where a x86 NaN value is serialized into the
140 // snapshot on the simulator during cross compilation. 140 // snapshot on the simulator during cross compilation.
141 v8::HandleScope scope(CcTest::isolate()); 141 v8::HandleScope scope(CcTest::isolate());
142 v8::Local<v8::Context> context = CcTest::NewContext(PRINT_EXTENSION); 142 v8::Local<v8::Context> context = CcTest::NewContext(PRINT_EXTENSION);
143 v8::Context::Scope context_scope(context); 143 v8::Context::Scope context_scope(context);
144 144
145 v8::Local<v8::Script> script = v8::Script::Compile(v8_str(code)); 145 v8::Local<v8::Script> script = v8::Script::Compile(v8_str(code));
146 v8::Local<v8::Object> result = v8::Local<v8::Object>::Cast(script->Run()); 146 v8::Local<v8::Object> result = v8::Local<v8::Object>::Cast(script->Run());
147 // Have to populate the handle manually, as it's not Cast-able. 147 i::Handle<i::JSReceiver> o = v8::Utils::OpenHandle(*result);
148 i::Handle<i::JSObject> o =
149 v8::Utils::OpenHandle<v8::Object, i::JSObject>(result);
150 i::Handle<i::JSArray> array1(reinterpret_cast<i::JSArray*>(*o)); 148 i::Handle<i::JSArray> array1(reinterpret_cast<i::JSArray*>(*o));
151 i::FixedDoubleArray* a = i::FixedDoubleArray::cast(array1->elements()); 149 i::FixedDoubleArray* a = i::FixedDoubleArray::cast(array1->elements());
152 double value = a->get_scalar(0); 150 double value = a->get_scalar(0);
153 CHECK(std::isnan(value) && 151 CHECK(std::isnan(value) &&
154 bit_cast<uint64_t>(value) == 152 bit_cast<uint64_t>(value) ==
155 bit_cast<uint64_t>(std::numeric_limits<double>::quiet_NaN())); 153 bit_cast<uint64_t>(std::numeric_limits<double>::quiet_NaN()));
156 } 154 }
157 155
158 156
159 TEST(NaN0) { 157 TEST(NaN0) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 F1 f = FUNCTION_CAST<F1>(code->entry()); 250 F1 f = FUNCTION_CAST<F1>(code->entry());
253 for (int i = 0; i < kNumCases; ++i) { 251 for (int i = 0; i < kNumCases; ++i) {
254 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); 252 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0));
255 ::printf("f(%d) = %d\n", i, res); 253 ::printf("f(%d) = %d\n", i, res);
256 CHECK_EQ(values[i], res); 254 CHECK_EQ(values[i], res);
257 } 255 }
258 } 256 }
259 257
260 258
261 #undef __ 259 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-unboxed-doubles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698