OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "src/date.h" | 27 #include "src/date.h" |
28 #include "src/debug/debug.h" | 28 #include "src/debug/debug.h" |
29 #include "src/deoptimizer.h" | 29 #include "src/deoptimizer.h" |
30 #include "src/elements.h" | 30 #include "src/elements.h" |
31 #include "src/execution.h" | 31 #include "src/execution.h" |
32 #include "src/field-index-inl.h" | 32 #include "src/field-index-inl.h" |
33 #include "src/field-index.h" | 33 #include "src/field-index.h" |
34 #include "src/field-type.h" | 34 #include "src/field-type.h" |
35 #include "src/frames-inl.h" | 35 #include "src/frames-inl.h" |
36 #include "src/full-codegen/full-codegen.h" | 36 #include "src/full-codegen/full-codegen.h" |
| 37 #include "src/globals.h" |
37 #include "src/ic/ic.h" | 38 #include "src/ic/ic.h" |
38 #include "src/identity-map.h" | 39 #include "src/identity-map.h" |
39 #include "src/interpreter/bytecode-array-iterator.h" | 40 #include "src/interpreter/bytecode-array-iterator.h" |
40 #include "src/interpreter/interpreter.h" | 41 #include "src/interpreter/interpreter.h" |
41 #include "src/isolate-inl.h" | 42 #include "src/isolate-inl.h" |
42 #include "src/keys.h" | 43 #include "src/keys.h" |
43 #include "src/list.h" | 44 #include "src/list.h" |
44 #include "src/log.h" | 45 #include "src/log.h" |
45 #include "src/lookup.h" | 46 #include "src/lookup.h" |
46 #include "src/macro-assembler.h" | 47 #include "src/macro-assembler.h" |
(...skipping 12652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12699 oddball->set_to_boolean(isolate->heap()->ToBoolean(to_boolean)); | 12700 oddball->set_to_boolean(isolate->heap()->ToBoolean(to_boolean)); |
12700 oddball->set_to_number(*to_number); | 12701 oddball->set_to_number(*to_number); |
12701 oddball->set_to_string(*internalized_to_string); | 12702 oddball->set_to_string(*internalized_to_string); |
12702 oddball->set_type_of(*internalized_type_of); | 12703 oddball->set_type_of(*internalized_type_of); |
12703 oddball->set_kind(kind); | 12704 oddball->set_kind(kind); |
12704 } | 12705 } |
12705 | 12706 |
12706 void Script::SetEvalOrigin(Handle<Script> script, | 12707 void Script::SetEvalOrigin(Handle<Script> script, |
12707 Handle<SharedFunctionInfo> outer_info, | 12708 Handle<SharedFunctionInfo> outer_info, |
12708 int eval_position) { | 12709 int eval_position) { |
12709 if (eval_position == RelocInfo::kNoPosition) { | 12710 if (eval_position == kNoSourcePosition) { |
12710 // If the position is missing, attempt to get the code offset from the | 12711 // If the position is missing, attempt to get the code offset from the |
12711 // current activation. Do not translate the code offset into source | 12712 // current activation. Do not translate the code offset into source |
12712 // position, but store it as negative value for lazy translation. | 12713 // position, but store it as negative value for lazy translation. |
12713 StackTraceFrameIterator it(script->GetIsolate()); | 12714 StackTraceFrameIterator it(script->GetIsolate()); |
12714 if (!it.done() && it.is_javascript()) { | 12715 if (!it.done() && it.is_javascript()) { |
12715 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); | 12716 FrameSummary summary = FrameSummary::GetFirst(it.javascript_frame()); |
12716 script->set_eval_from_shared(summary.function()->shared()); | 12717 script->set_eval_from_shared(summary.function()->shared()); |
12717 script->set_eval_from_position(-summary.code_offset()); | 12718 script->set_eval_from_position(-summary.code_offset()); |
12718 return; | 12719 return; |
12719 } | 12720 } |
(...skipping 4350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17070 set->ElementAdded(); | 17071 set->ElementAdded(); |
17071 } | 17072 } |
17072 return set; | 17073 return set; |
17073 } | 17074 } |
17074 | 17075 |
17075 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src, | 17076 Handle<Object> CompilationCacheTable::Lookup(Handle<String> src, |
17076 Handle<Context> context, | 17077 Handle<Context> context, |
17077 LanguageMode language_mode) { | 17078 LanguageMode language_mode) { |
17078 Isolate* isolate = GetIsolate(); | 17079 Isolate* isolate = GetIsolate(); |
17079 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 17080 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
17080 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition); | 17081 StringSharedKey key(src, shared, language_mode, kNoSourcePosition); |
17081 int entry = FindEntry(&key); | 17082 int entry = FindEntry(&key); |
17082 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 17083 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
17083 int index = EntryToIndex(entry); | 17084 int index = EntryToIndex(entry); |
17084 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value(); | 17085 if (!get(index)->IsFixedArray()) return isolate->factory()->undefined_value(); |
17085 return Handle<Object>(get(index + 1), isolate); | 17086 return Handle<Object>(get(index + 1), isolate); |
17086 } | 17087 } |
17087 | 17088 |
17088 | 17089 |
17089 Handle<Object> CompilationCacheTable::LookupEval( | 17090 Handle<Object> CompilationCacheTable::LookupEval( |
17090 Handle<String> src, Handle<SharedFunctionInfo> outer_info, | 17091 Handle<String> src, Handle<SharedFunctionInfo> outer_info, |
(...skipping 19 matching lines...) Expand all Loading... |
17110 if (entry == kNotFound) return isolate->factory()->undefined_value(); | 17111 if (entry == kNotFound) return isolate->factory()->undefined_value(); |
17111 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); | 17112 return Handle<Object>(get(EntryToIndex(entry) + 1), isolate); |
17112 } | 17113 } |
17113 | 17114 |
17114 | 17115 |
17115 Handle<CompilationCacheTable> CompilationCacheTable::Put( | 17116 Handle<CompilationCacheTable> CompilationCacheTable::Put( |
17116 Handle<CompilationCacheTable> cache, Handle<String> src, | 17117 Handle<CompilationCacheTable> cache, Handle<String> src, |
17117 Handle<Context> context, LanguageMode language_mode, Handle<Object> value) { | 17118 Handle<Context> context, LanguageMode language_mode, Handle<Object> value) { |
17118 Isolate* isolate = cache->GetIsolate(); | 17119 Isolate* isolate = cache->GetIsolate(); |
17119 Handle<SharedFunctionInfo> shared(context->closure()->shared()); | 17120 Handle<SharedFunctionInfo> shared(context->closure()->shared()); |
17120 StringSharedKey key(src, shared, language_mode, RelocInfo::kNoPosition); | 17121 StringSharedKey key(src, shared, language_mode, kNoSourcePosition); |
17121 Handle<Object> k = key.AsHandle(isolate); | 17122 Handle<Object> k = key.AsHandle(isolate); |
17122 cache = EnsureCapacity(cache, 1, &key); | 17123 cache = EnsureCapacity(cache, 1, &key); |
17123 int entry = cache->FindInsertionEntry(key.Hash()); | 17124 int entry = cache->FindInsertionEntry(key.Hash()); |
17124 cache->set(EntryToIndex(entry), *k); | 17125 cache->set(EntryToIndex(entry), *k); |
17125 cache->set(EntryToIndex(entry) + 1, *value); | 17126 cache->set(EntryToIndex(entry) + 1, *value); |
17126 cache->ElementAdded(); | 17127 cache->ElementAdded(); |
17127 return cache; | 17128 return cache; |
17128 } | 17129 } |
17129 | 17130 |
17130 | 17131 |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18948 | 18949 |
18949 Object* data_obj = | 18950 Object* data_obj = |
18950 constructor->shared()->get_api_func_data()->access_check_info(); | 18951 constructor->shared()->get_api_func_data()->access_check_info(); |
18951 if (data_obj->IsUndefined(isolate)) return nullptr; | 18952 if (data_obj->IsUndefined(isolate)) return nullptr; |
18952 | 18953 |
18953 return AccessCheckInfo::cast(data_obj); | 18954 return AccessCheckInfo::cast(data_obj); |
18954 } | 18955 } |
18955 | 18956 |
18956 } // namespace internal | 18957 } // namespace internal |
18957 } // namespace v8 | 18958 } // namespace v8 |
OLD | NEW |