| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/list.h" | 7 #include "src/list.h" |
| 8 #include "src/objects.h" | 8 #include "src/objects.h" |
| 9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 static Handle<Code> GetDummyCode(Isolate* isolate) { | 16 static Handle<Code> GetDummyCode(Isolate* isolate) { |
| 17 CodeDesc desc = {nullptr, // buffer | 17 CodeDesc desc = {nullptr, // buffer |
| 18 0, // buffer_size | 18 0, // buffer_size |
| 19 0, // instr_size | 19 0, // instr_size |
| 20 0, // reloc_size | 20 0, // reloc_size |
| 21 0, // constant_pool_size | 21 0, // constant_pool_size |
| 22 nullptr, // unwinding_info |
| 23 0, // unwinding_info_size |
| 22 nullptr}; // origin | 24 nullptr}; // origin |
| 23 Code::Flags flags = | 25 Code::Flags flags = |
| 24 Code::ComputeFlags(Code::LOAD_IC, kNoExtraICState, kCacheOnReceiver); | 26 Code::ComputeFlags(Code::LOAD_IC, kNoExtraICState, kCacheOnReceiver); |
| 25 Handle<Code> self_ref; | 27 Handle<Code> self_ref; |
| 26 return isolate->factory()->NewCode(desc, flags, self_ref); | 28 return isolate->factory()->NewCode(desc, flags, self_ref); |
| 27 } | 29 } |
| 28 | 30 |
| 29 } // namespace | 31 } // namespace |
| 30 | 32 |
| 31 TEST(CodeCache) { | 33 TEST(CodeCache) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Check that lookup works not only right after storing. | 68 // Check that lookup works not only right after storing. |
| 67 for (int i = 0; i < kEntries; i++) { | 69 for (int i = 0; i < kEntries; i++) { |
| 68 Handle<Name> name = names.at(i); | 70 Handle<Name> name = names.at(i); |
| 69 Handle<Code> code = codes.at(i); | 71 Handle<Code> code = codes.at(i); |
| 70 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); | 72 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); |
| 71 } | 73 } |
| 72 } | 74 } |
| 73 | 75 |
| 74 } // namespace internal | 76 } // namespace internal |
| 75 } // namespace v8 | 77 } // namespace v8 |
| OLD | NEW |