Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: src/ic/ic-inl.h

Issue 1276533003: [runtime] Store constructor function index on primitive maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm failures Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_IC_INL_H_ 5 #ifndef V8_IC_INL_H_
6 #define V8_IC_INL_H_ 6 #define V8_IC_INL_H_
7 7
8 #include "src/ic/ic.h" 8 #include "src/ic/ic.h"
9 9
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 121
122 Code* IC::raw_target() const { 122 Code* IC::raw_target() const {
123 return GetTargetAtAddress(address(), constant_pool()); 123 return GetTargetAtAddress(address(), constant_pool());
124 } 124 }
125 125
126 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); } 126 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); }
127 127
128 128
129 JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) { 129 JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) {
130 Isolate* isolate = receiver_map->GetIsolate(); 130 DisallowHeapAllocation no_alloc;
131 if (receiver_map == isolate->heap()->boolean_map()) { 131 if (receiver_map->IsPrimitiveMap()) {
132 return native_context->boolean_function(); 132 int constructor_function_index =
133 receiver_map->GetConstructorFunctionIndex();
134 if (constructor_function_index != Map::kNoConstructorFunctionIndex) {
135 return JSFunction::cast(native_context->get(constructor_function_index));
136 }
133 } 137 }
134 if (receiver_map->instance_type() == HEAP_NUMBER_TYPE) {
135 return native_context->number_function();
136 }
137 if (receiver_map->instance_type() < FIRST_NONSTRING_TYPE) {
138 return native_context->string_function();
139 }
140 if (receiver_map->instance_type() == SYMBOL_TYPE) {
141 return native_context->symbol_function();
142 }
143 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
144 if (receiver_map == isolate->heap()->type##_map()) { \
145 return native_context->type##_function(); \
146 }
147 SIMD128_TYPES(SIMD128_TYPE)
148 #undef SIMD128_TYPE
149 return nullptr; 138 return nullptr;
150 } 139 }
151 140
152 141
153 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, 142 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map,
154 bool receiver_is_holder, Isolate* isolate, 143 bool receiver_is_holder, Isolate* isolate,
155 CacheHolderFlag* flag) { 144 CacheHolderFlag* flag) {
156 if (receiver_is_holder) { 145 if (receiver_is_holder) {
157 *flag = kCacheOnReceiver; 146 *flag = kCacheOnReceiver;
158 return receiver_map; 147 return receiver_map;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { 189 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) {
201 Code* host = 190 Code* host =
202 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; 191 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
203 return (host->kind() == Code::OPTIMIZED_FUNCTION && 192 return (host->kind() == Code::OPTIMIZED_FUNCTION &&
204 host->marked_for_deoptimization()); 193 host->marked_for_deoptimization());
205 } 194 }
206 } 195 }
207 } // namespace v8::internal 196 } // namespace v8::internal
208 197
209 #endif // V8_IC_INL_H_ 198 #endif // V8_IC_INL_H_
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/layout-descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698