| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3114 | 3114 |
| 3115 CodeDesc desc; | 3115 CodeDesc desc; |
| 3116 assm.GetCode(&desc); | 3116 assm.GetCode(&desc); |
| 3117 Handle<Code> code = isolate->factory()->NewCode( | 3117 Handle<Code> code = isolate->factory()->NewCode( |
| 3118 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3118 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 3119 #ifdef OBJECT_PRINT | 3119 #ifdef OBJECT_PRINT |
| 3120 code->Print(std::cout); | 3120 code->Print(std::cout); |
| 3121 #endif | 3121 #endif |
| 3122 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3122 F1 f = FUNCTION_CAST<F1>(code->entry()); |
| 3123 for (int i = 0; i < kNumCases; ++i) { | 3123 for (int i = 0; i < kNumCases; ++i) { |
| 3124 int res = reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); | 3124 int64_t res = reinterpret_cast<int64_t>( |
| 3125 ::printf("f(%d) = %d\n", i, res); | 3125 CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); |
| 3126 ::printf("f(%d) = %" PRId64 "\n", i, res); |
| 3126 CHECK_EQ(values[i], static_cast<int>(res)); | 3127 CHECK_EQ(values[i], static_cast<int>(res)); |
| 3127 } | 3128 } |
| 3128 } | 3129 } |
| 3129 | 3130 |
| 3130 | 3131 |
| 3131 TEST(jump_tables2) { | 3132 TEST(jump_tables2) { |
| 3132 // Test jump tables with backward jumps. | 3133 // Test jump tables with backward jumps. |
| 3133 CcTest::InitializeVM(); | 3134 CcTest::InitializeVM(); |
| 3134 Isolate* isolate = CcTest::i_isolate(); | 3135 Isolate* isolate = CcTest::i_isolate(); |
| 3135 HandleScope scope(isolate); | 3136 HandleScope scope(isolate); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3185 | 3186 |
| 3186 CodeDesc desc; | 3187 CodeDesc desc; |
| 3187 assm.GetCode(&desc); | 3188 assm.GetCode(&desc); |
| 3188 Handle<Code> code = isolate->factory()->NewCode( | 3189 Handle<Code> code = isolate->factory()->NewCode( |
| 3189 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3190 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 3190 #ifdef OBJECT_PRINT | 3191 #ifdef OBJECT_PRINT |
| 3191 code->Print(std::cout); | 3192 code->Print(std::cout); |
| 3192 #endif | 3193 #endif |
| 3193 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3194 F1 f = FUNCTION_CAST<F1>(code->entry()); |
| 3194 for (int i = 0; i < kNumCases; ++i) { | 3195 for (int i = 0; i < kNumCases; ++i) { |
| 3195 int res = reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); | 3196 int64_t res = reinterpret_cast<int64_t>( |
| 3196 ::printf("f(%d) = %d\n", i, res); | 3197 CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); |
| 3198 ::printf("f(%d) = %" PRId64 "\n", i, res); |
| 3197 CHECK_EQ(values[i], res); | 3199 CHECK_EQ(values[i], res); |
| 3198 } | 3200 } |
| 3199 } | 3201 } |
| 3200 | 3202 |
| 3201 | 3203 |
| 3202 TEST(jump_tables3) { | 3204 TEST(jump_tables3) { |
| 3203 // Test jump tables with backward jumps and embedded heap objects. | 3205 // Test jump tables with backward jumps and embedded heap objects. |
| 3204 CcTest::InitializeVM(); | 3206 CcTest::InitializeVM(); |
| 3205 Isolate* isolate = CcTest::i_isolate(); | 3207 Isolate* isolate = CcTest::i_isolate(); |
| 3206 HandleScope scope(isolate); | 3208 HandleScope scope(isolate); |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4440 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); | 4442 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); |
| 4441 test.fOp2 = -5.0; | 4443 test.fOp2 = -5.0; |
| 4442 | 4444 |
| 4443 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4445 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); |
| 4444 CHECK_EQ(true, std::isnan(test.dRes)); | 4446 CHECK_EQ(true, std::isnan(test.dRes)); |
| 4445 CHECK_EQ(true, std::isnan(test.fRes)); | 4447 CHECK_EQ(true, std::isnan(test.fRes)); |
| 4446 } | 4448 } |
| 4447 | 4449 |
| 4448 | 4450 |
| 4449 #undef __ | 4451 #undef __ |
| OLD | NEW |