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 | |
46 CcTest::InitializeVM(); | 43 CcTest::InitializeVM(); |
47 Isolate* isolate = CcTest::i_isolate(); | 44 Isolate* isolate = CcTest::i_isolate(); |
48 Factory* factory = isolate->factory(); | 45 Factory* factory = isolate->factory(); |
49 HandleScope handle_scope(isolate); | 46 HandleScope handle_scope(isolate); |
50 | 47 |
51 Handle<Map> map = | 48 Handle<Map> map = |
52 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize, FAST_ELEMENTS); | 49 factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize, FAST_ELEMENTS); |
53 | 50 |
54 // This number should be large enough to cause the code cache to use its | 51 // This number should be large enough to cause the code cache to use its |
55 // hash table storage format. | 52 // hash table storage format. |
(...skipping 24 matching lines...) Expand all Loading... |
80 // Check that lookup works not only right after storing. | 77 // Check that lookup works not only right after storing. |
81 for (int i = 0; i < kEntries; i++) { | 78 for (int i = 0; i < kEntries; i++) { |
82 Handle<Name> name = names.at(i); | 79 Handle<Name> name = names.at(i); |
83 Handle<Code> code = codes.at(i); | 80 Handle<Code> code = codes.at(i); |
84 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); | 81 CHECK_EQ(*code, map->LookupInCodeCache(*name, code->flags())); |
85 } | 82 } |
86 } | 83 } |
87 | 84 |
88 } // namespace internal | 85 } // namespace internal |
89 } // namespace v8 | 86 } // namespace v8 |
OLD | NEW |