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

Side by Side Diff: src/stub-cache.cc

Issue 8383033: Handlify simple functions of [keyed] load stub compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 *secondary = *primary; 102 *secondary = *primary;
103 } 103 }
104 104
105 // Update primary cache. 105 // Update primary cache.
106 primary->key = name; 106 primary->key = name;
107 primary->value = code; 107 primary->value = code;
108 return code; 108 return code;
109 } 109 }
110 110
111 111
112 Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
113 Handle<JSObject> object,
114 Handle<JSObject> last) {
115 CALL_HEAP_FUNCTION(isolate(),
116 (set_failure(NULL),
117 CompileLoadNonexistent(*name, *object, *last)),
118 Code);
119 }
120
121
122 Handle<Code> StubCache::ComputeLoadNonexistent(Handle<String> name, 112 Handle<Code> StubCache::ComputeLoadNonexistent(Handle<String> name,
123 Handle<JSObject> receiver) { 113 Handle<JSObject> receiver) {
124 ASSERT(receiver->IsGlobalObject() || receiver->HasFastProperties()); 114 ASSERT(receiver->IsGlobalObject() || receiver->HasFastProperties());
125 // If no global objects are present in the prototype chain, the load 115 // If no global objects are present in the prototype chain, the load
126 // nonexistent IC stub can be shared for all names for a given map 116 // nonexistent IC stub can be shared for all names for a given map
127 // and we use the empty string for the map cache in that case. If 117 // and we use the empty string for the map cache in that case. If
128 // there are global objects involved, we need to check global 118 // there are global objects involved, we need to check global
129 // property cells in the stub and therefore the stub will be 119 // property cells in the stub and therefore the stub will be
130 // specific to the name. 120 // specific to the name.
131 Handle<String> cache_name = factory()->empty_string(); 121 Handle<String> cache_name = factory()->empty_string();
(...skipping 13 matching lines...) Expand all
145 LoadStubCompiler compiler(isolate_); 135 LoadStubCompiler compiler(isolate_);
146 Handle<Code> code = 136 Handle<Code> code =
147 compiler.CompileLoadNonexistent(cache_name, receiver, last); 137 compiler.CompileLoadNonexistent(cache_name, receiver, last);
148 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name)); 138 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *cache_name));
149 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code)); 139 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *cache_name, *code));
150 JSObject::UpdateMapCodeCache(receiver, cache_name, code); 140 JSObject::UpdateMapCodeCache(receiver, cache_name, code);
151 return code; 141 return code;
152 } 142 }
153 143
154 144
155 Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object,
156 Handle<JSObject> holder,
157 int index,
158 Handle<String> name) {
159 CALL_HEAP_FUNCTION(isolate(),
160 (set_failure(NULL),
161 CompileLoadField(*object, *holder, index, *name)),
162 Code);
163 }
164
165
166 Handle<Code> StubCache::ComputeLoadField(Handle<String> name, 145 Handle<Code> StubCache::ComputeLoadField(Handle<String> name,
167 Handle<JSObject> receiver, 146 Handle<JSObject> receiver,
168 Handle<JSObject> holder, 147 Handle<JSObject> holder,
169 int field_index) { 148 int field_index) {
170 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 149 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
171 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD); 150 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, FIELD);
172 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 151 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
173 if (probe->IsCode()) return Handle<Code>::cast(probe); 152 if (probe->IsCode()) return Handle<Code>::cast(probe);
174 153
175 LoadStubCompiler compiler(isolate_); 154 LoadStubCompiler compiler(isolate_);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 LoadStubCompiler compiler(isolate_); 186 LoadStubCompiler compiler(isolate_);
208 Handle<Code> code = 187 Handle<Code> code =
209 compiler.CompileLoadCallback(name, receiver, holder, callback); 188 compiler.CompileLoadCallback(name, receiver, holder, callback);
210 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 189 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
211 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 190 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
212 JSObject::UpdateMapCodeCache(receiver, name, code); 191 JSObject::UpdateMapCodeCache(receiver, name, code);
213 return code; 192 return code;
214 } 193 }
215 194
216 195
217 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
218 Handle<JSObject> holder,
219 Handle<Object> value,
220 Handle<String> name) {
221 CALL_HEAP_FUNCTION(isolate(),
222 (set_failure(NULL),
223 CompileLoadConstant(*object, *holder, *value, *name)),
224 Code);
225 }
226
227
228 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, 196 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
229 Handle<JSObject> receiver, 197 Handle<JSObject> receiver,
230 Handle<JSObject> holder, 198 Handle<JSObject> holder,
231 Handle<Object> value) { 199 Handle<Object> value) {
232 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 200 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
233 Code::Flags flags = 201 Code::Flags flags =
234 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); 202 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
235 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 203 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
236 if (probe->IsCode()) return Handle<Code>::cast(probe); 204 if (probe->IsCode()) return Handle<Code>::cast(probe);
237 205
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 238 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
271 JSObject::UpdateMapCodeCache(receiver, name, code); 239 JSObject::UpdateMapCodeCache(receiver, name, code);
272 return code; 240 return code;
273 } 241 }
274 242
275 243
276 Handle<Code> StubCache::ComputeLoadNormal() { 244 Handle<Code> StubCache::ComputeLoadNormal() {
277 return isolate_->builtins()->LoadIC_Normal(); 245 return isolate_->builtins()->LoadIC_Normal();
278 } 246 }
279 247
248
280 Handle<Code> LoadStubCompiler::CompileLoadGlobal( 249 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
281 Handle<JSObject> object, 250 Handle<JSObject> object,
282 Handle<GlobalObject> holder, 251 Handle<GlobalObject> holder,
283 Handle<JSGlobalPropertyCell> cell, 252 Handle<JSGlobalPropertyCell> cell,
284 Handle<String> name, 253 Handle<String> name,
285 bool is_dont_delete) { 254 bool is_dont_delete) {
286 CALL_HEAP_FUNCTION(isolate(), 255 CALL_HEAP_FUNCTION(isolate(),
287 (set_failure(NULL), 256 (set_failure(NULL),
288 CompileLoadGlobal( 257 CompileLoadGlobal(
289 *object, *holder, *cell, *name, is_dont_delete)), 258 *object, *holder, *cell, *name, is_dont_delete)),
290 Code); 259 Code);
291 } 260 }
261
262
292 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name, 263 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name,
293 Handle<JSObject> receiver, 264 Handle<JSObject> receiver,
294 Handle<GlobalObject> holder, 265 Handle<GlobalObject> holder,
295 Handle<JSGlobalPropertyCell> cell, 266 Handle<JSGlobalPropertyCell> cell,
296 bool is_dont_delete) { 267 bool is_dont_delete) {
297 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 268 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
298 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL); 269 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
299 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 270 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
300 if (probe->IsCode()) return Handle<Code>::cast(probe); 271 if (probe->IsCode()) return Handle<Code>::cast(probe);
301 272
302 LoadStubCompiler compiler(isolate_); 273 LoadStubCompiler compiler(isolate_);
303 Handle<Code> code = 274 Handle<Code> code =
304 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete); 275 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete);
305 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 276 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
306 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 277 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
307 JSObject::UpdateMapCodeCache(receiver, name, code); 278 JSObject::UpdateMapCodeCache(receiver, name, code);
308 return code; 279 return code;
309 } 280 }
310 281
311 282
312 Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name,
313 Handle<JSObject> object,
314 Handle<JSObject> holder,
315 int index) {
316 CALL_HEAP_FUNCTION(isolate(),
317 (set_failure(NULL),
318 CompileLoadField(*name, *object, *holder, index)),
319 Code);
320 }
321
322
323 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name, 283 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name,
324 Handle<JSObject> receiver, 284 Handle<JSObject> receiver,
325 Handle<JSObject> holder, 285 Handle<JSObject> holder,
326 int field_index) { 286 int field_index) {
327 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 287 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
328 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD); 288 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, FIELD);
329 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 289 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
330 if (probe->IsCode()) return Handle<Code>::cast(probe); 290 if (probe->IsCode()) return Handle<Code>::cast(probe);
331 291
332 KeyedLoadStubCompiler compiler(isolate_); 292 KeyedLoadStubCompiler compiler(isolate_);
333 Handle<Code> code = 293 Handle<Code> code =
334 compiler.CompileLoadField(name, receiver, holder, field_index); 294 compiler.CompileLoadField(name, receiver, holder, field_index);
335 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 295 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
336 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 296 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
337 JSObject::UpdateMapCodeCache(receiver, name, code); 297 JSObject::UpdateMapCodeCache(receiver, name, code);
338 return code; 298 return code;
339 } 299 }
340 300
341 301
342 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(Handle<String> name,
343 Handle<JSObject> object,
344 Handle<JSObject> holder,
345 Handle<Object> value) {
346 CALL_HEAP_FUNCTION(isolate(),
347 (set_failure(NULL),
348 CompileLoadConstant(*name, *object, *holder, *value)),
349 Code);
350 }
351
352
353 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name, 302 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name,
354 Handle<JSObject> receiver, 303 Handle<JSObject> receiver,
355 Handle<JSObject> holder, 304 Handle<JSObject> holder,
356 Handle<Object> value) { 305 Handle<Object> value) {
357 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 306 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
358 Code::Flags flags = 307 Code::Flags flags =
359 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION); 308 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION);
360 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 309 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
361 if (probe->IsCode()) return Handle<Code>::cast(probe); 310 if (probe->IsCode()) return Handle<Code>::cast(probe);
362 311
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 KeyedLoadStubCompiler compiler(isolate_); 374 KeyedLoadStubCompiler compiler(isolate_);
426 Handle<Code> code = 375 Handle<Code> code =
427 compiler.CompileLoadCallback(name, receiver, holder, callback); 376 compiler.CompileLoadCallback(name, receiver, holder, callback);
428 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 377 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
429 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 378 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
430 JSObject::UpdateMapCodeCache(receiver, name, code); 379 JSObject::UpdateMapCodeCache(receiver, name, code);
431 return code; 380 return code;
432 } 381 }
433 382
434 383
435 Handle<Code> KeyedLoadStubCompiler::CompileLoadArrayLength(
436 Handle<String> name) {
437 CALL_HEAP_FUNCTION(isolate(),
438 (set_failure(NULL),
439 CompileLoadArrayLength(*name)),
440 Code);
441 }
442
443 Handle<Code> StubCache::ComputeKeyedLoadArrayLength(Handle<String> name, 384 Handle<Code> StubCache::ComputeKeyedLoadArrayLength(Handle<String> name,
444 Handle<JSArray> receiver) { 385 Handle<JSArray> receiver) {
445 Code::Flags flags = 386 Code::Flags flags =
446 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS); 387 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
447 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 388 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
448 if (probe->IsCode()) return Handle<Code>::cast(probe); 389 if (probe->IsCode()) return Handle<Code>::cast(probe);
449 390
450 KeyedLoadStubCompiler compiler(isolate_); 391 KeyedLoadStubCompiler compiler(isolate_);
451 Handle<Code> code = compiler.CompileLoadArrayLength(name); 392 Handle<Code> code = compiler.CompileLoadArrayLength(name);
452 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 393 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
453 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 394 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
454 JSObject::UpdateMapCodeCache(receiver, name, code); 395 JSObject::UpdateMapCodeCache(receiver, name, code);
455 return code; 396 return code;
456 } 397 }
457 398
458 399
459 Handle<Code> KeyedLoadStubCompiler::CompileLoadStringLength(
460 Handle<String> name) {
461 CALL_HEAP_FUNCTION(isolate(),
462 (set_failure(NULL),
463 CompileLoadStringLength(*name)),
464 Code);
465 }
466
467 Handle<Code> StubCache::ComputeKeyedLoadStringLength(Handle<String> name, 400 Handle<Code> StubCache::ComputeKeyedLoadStringLength(Handle<String> name,
468 Handle<String> receiver) { 401 Handle<String> receiver) {
469 Code::Flags flags = 402 Code::Flags flags =
470 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS); 403 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
471 Handle<Map> map(receiver->map()); 404 Handle<Map> map(receiver->map());
472 Handle<Object> probe(map->FindInCodeCache(*name, flags)); 405 Handle<Object> probe(map->FindInCodeCache(*name, flags));
473 if (probe->IsCode()) return Handle<Code>::cast(probe); 406 if (probe->IsCode()) return Handle<Code>::cast(probe);
474 407
475 KeyedLoadStubCompiler compiler(isolate_); 408 KeyedLoadStubCompiler compiler(isolate_);
476 Handle<Code> code = compiler.CompileLoadStringLength(name); 409 Handle<Code> code = compiler.CompileLoadStringLength(name);
477 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 410 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
478 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 411 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
479 Map::UpdateCodeCache(map, name, code); 412 Map::UpdateCodeCache(map, name, code);
480 return code; 413 return code;
481 } 414 }
482 415
483 416
484 Handle<Code> KeyedLoadStubCompiler::CompileLoadFunctionPrototype(
485 Handle<String> name) {
486 CALL_HEAP_FUNCTION(isolate(),
487 (set_failure(NULL),
488 CompileLoadFunctionPrototype(*name)),
489 Code);
490 }
491
492
493 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype( 417 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype(
494 Handle<String> name, 418 Handle<String> name,
495 Handle<JSFunction> receiver) { 419 Handle<JSFunction> receiver) {
496 Code::Flags flags = 420 Code::Flags flags =
497 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS); 421 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CALLBACKS);
498 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 422 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
499 if (probe->IsCode()) return Handle<Code>::cast(probe); 423 if (probe->IsCode()) return Handle<Code>::cast(probe);
500 424
501 KeyedLoadStubCompiler compiler(isolate_); 425 KeyedLoadStubCompiler compiler(isolate_);
502 Handle<Code> code = compiler.CompileLoadFunctionPrototype(name); 426 Handle<Code> code = compiler.CompileLoadFunctionPrototype(name);
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 if (!lookup->IsProperty()) { 1589 if (!lookup->IsProperty()) {
1666 lookup->NotFound(); 1590 lookup->NotFound();
1667 Object* proto = holder->GetPrototype(); 1591 Object* proto = holder->GetPrototype();
1668 if (!proto->IsNull()) { 1592 if (!proto->IsNull()) {
1669 proto->Lookup(name, lookup); 1593 proto->Lookup(name, lookup);
1670 } 1594 }
1671 } 1595 }
1672 } 1596 }
1673 1597
1674 1598
1599 Handle<Code> LoadStubCompiler::GetCode(PropertyType type, Handle<String> name) {
1600 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
1601 Handle<Code> code = GetCodeWithFlags(flags, name);
1602 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
1603 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
1604 return code;
1605 }
1675 1606
1676 MaybeObject* LoadStubCompiler::GetCode(PropertyType type, String* name) { 1607
1608 // TODO(ulan): Eliminate this function when the stub cache is fully
1609 // handlified.
1610 MaybeObject* LoadStubCompiler::TryGetCode(PropertyType type, String* name) {
1677 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type); 1611 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, type);
1678 MaybeObject* result = TryGetCodeWithFlags(flags, name); 1612 MaybeObject* result = TryGetCodeWithFlags(flags, name);
1679 if (!result->IsFailure()) { 1613 if (!result->IsFailure()) {
1680 PROFILE(isolate(), 1614 PROFILE(isolate(),
1681 CodeCreateEvent(Logger::LOAD_IC_TAG, 1615 CodeCreateEvent(Logger::LOAD_IC_TAG,
1682 Code::cast(result->ToObjectUnchecked()), 1616 Code::cast(result->ToObjectUnchecked()),
1683 name)); 1617 name));
1684 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, 1618 GDBJIT(AddCode(GDBJITInterface::LOAD_IC,
1685 name, 1619 name,
1686 Code::cast(result->ToObjectUnchecked()))); 1620 Code::cast(result->ToObjectUnchecked())));
1687 } 1621 }
1688 return result; 1622 return result;
1689 } 1623 }
1690 1624
1691 1625
1692 MaybeObject* KeyedLoadStubCompiler::GetCode(PropertyType type, 1626 Handle<Code> KeyedLoadStubCompiler::GetCode(PropertyType type,
1627 Handle<String> name,
1628 InlineCacheState state) {
1629 Code::Flags flags = Code::ComputeFlags(
1630 Code::KEYED_LOAD_IC, state, Code::kNoExtraICState, type);
1631 Handle<Code> code = GetCodeWithFlags(flags, name);
1632 PROFILE(isolate(), CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
1633 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
1634 return code;
1635 }
1636
1637 // TODO(ulan): Eliminate this function when the stub cache is fully
1638 // handlified.
1639 MaybeObject* KeyedLoadStubCompiler::TryGetCode(PropertyType type,
1693 String* name, 1640 String* name,
1694 InlineCacheState state) { 1641 InlineCacheState state) {
1695 Code::Flags flags = Code::ComputeFlags( 1642 Code::Flags flags = Code::ComputeFlags(
1696 Code::KEYED_LOAD_IC, state, Code::kNoExtraICState, type); 1643 Code::KEYED_LOAD_IC, state, Code::kNoExtraICState, type);
1697 MaybeObject* result = TryGetCodeWithFlags(flags, name); 1644 MaybeObject* result = TryGetCodeWithFlags(flags, name);
1698 if (!result->IsFailure()) { 1645 if (!result->IsFailure()) {
1699 PROFILE(isolate(), 1646 PROFILE(isolate(),
1700 CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, 1647 CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG,
1701 Code::cast(result->ToObjectUnchecked()), 1648 Code::cast(result->ToObjectUnchecked()),
1702 name)); 1649 name));
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 expected_receiver_type_ = 1877 expected_receiver_type_ =
1931 FunctionTemplateInfo::cast(signature->receiver()); 1878 FunctionTemplateInfo::cast(signature->receiver());
1932 } 1879 }
1933 } 1880 }
1934 1881
1935 is_simple_api_call_ = true; 1882 is_simple_api_call_ = true;
1936 } 1883 }
1937 1884
1938 1885
1939 } } // namespace v8::internal 1886 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698