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/factory.h" | 7 #include "src/factory.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 #include "src/list.h" | 9 #include "src/list.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 nullptr}; // origin | 33 nullptr}; // origin |
34 Code::Flags flags = | 34 Code::Flags flags = |
35 Code::ComputeFlags(Code::LOAD_IC, kNoExtraICState, kCacheOnReceiver); | 35 Code::ComputeFlags(Code::LOAD_IC, kNoExtraICState, kCacheOnReceiver); |
36 Handle<Code> self_ref; | 36 Handle<Code> self_ref; |
37 return isolate->factory()->NewCode(desc, flags, self_ref); | 37 return isolate->factory()->NewCode(desc, flags, self_ref); |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 TEST(CodeCache) { | 42 TEST(CodeCache) { |
| 43 // TODO(ishell): Experiment: don't cache handlers in map-specific code cache. |
| 44 return; |
| 45 |
43 CcTest::InitializeVM(); | 46 CcTest::InitializeVM(); |
44 Isolate* isolate = CcTest::i_isolate(); | 47 Isolate* isolate = CcTest::i_isolate(); |
45 Factory* factory = isolate->factory(); | 48 Factory* factory = isolate->factory(); |
46 HandleScope handle_scope(isolate); | 49 HandleScope handle_scope(isolate); |
47 | 50 |
48 Handle<Map> map = | 51 Handle<Map> map = |
49 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize, FAST_ELEMENTS); | 52 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize, FAST_ELEMENTS); |
50 | 53 |
51 // This number should be large enough to cause the code cache to use its | 54 // This number should be large enough to cause the code cache to use its |
52 // hash table storage format. | 55 // hash table storage format. |
(...skipping 24 matching lines...) Expand all Loading... |
77 // Check that lookup works not only right after storing. | 80 // Check that lookup works not only right after storing. |
78 for (int i = 0; i < kEntries; i++) { | 81 for (int i = 0; i < kEntries; i++) { |
79 Handle<Name> name = names.at(i); | 82 Handle<Name> name = names.at(i); |
80 Handle<Code> code = codes.at(i); | 83 Handle<Code> code = codes.at(i); |
81 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); | 84 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); |
82 } | 85 } |
83 } | 86 } |
84 | 87 |
85 } // namespace internal | 88 } // namespace internal |
86 } // namespace v8 | 89 } // namespace v8 |
OLD | NEW |