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

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

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/symbol.js » ('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 // 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 Handle<JSFunction> function) { 565 Handle<JSFunction> function) {
566 // Compute the check type and the map. 566 // Compute the check type and the map.
567 InlineCacheHolderFlag cache_holder = 567 InlineCacheHolderFlag cache_holder =
568 IC::GetCodeCacheForObject(*object, *holder); 568 IC::GetCodeCacheForObject(*object, *holder);
569 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); 569 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder));
570 570
571 // Compute check type based on receiver/holder. 571 // Compute check type based on receiver/holder.
572 CheckType check = RECEIVER_MAP_CHECK; 572 CheckType check = RECEIVER_MAP_CHECK;
573 if (object->IsString()) { 573 if (object->IsString()) {
574 check = STRING_CHECK; 574 check = STRING_CHECK;
575 } else if (object->IsSymbol()) {
576 check = SYMBOL_CHECK;
575 } else if (object->IsNumber()) { 577 } else if (object->IsNumber()) {
576 check = NUMBER_CHECK; 578 check = NUMBER_CHECK;
577 } else if (object->IsBoolean()) { 579 } else if (object->IsBoolean()) {
578 check = BOOLEAN_CHECK; 580 check = BOOLEAN_CHECK;
579 } 581 }
580 582
581 Code::Flags flags = 583 Code::Flags flags =
582 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state, 584 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state,
583 cache_holder, argc); 585 cache_holder, argc);
584 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 586 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
(...skipping 21 matching lines...) Expand all
606 Handle<JSObject> holder, 608 Handle<JSObject> holder,
607 PropertyIndex index) { 609 PropertyIndex index) {
608 // Compute the check type and the map. 610 // Compute the check type and the map.
609 InlineCacheHolderFlag cache_holder = 611 InlineCacheHolderFlag cache_holder =
610 IC::GetCodeCacheForObject(*object, *holder); 612 IC::GetCodeCacheForObject(*object, *holder);
611 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); 613 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder));
612 614
613 // TODO(1233596): We cannot do receiver map check for non-JS objects 615 // TODO(1233596): We cannot do receiver map check for non-JS objects
614 // because they may be represented as immediates without a 616 // because they may be represented as immediates without a
615 // map. Instead, we check against the map in the holder. 617 // map. Instead, we check against the map in the holder.
616 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { 618 if (object->IsNumber() || object->IsSymbol() ||
619 object->IsBoolean() || object->IsString()) {
617 object = holder; 620 object = holder;
618 } 621 }
619 622
620 Code::Flags flags = 623 Code::Flags flags =
621 Code::ComputeMonomorphicFlags(kind, Code::FIELD, extra_state, 624 Code::ComputeMonomorphicFlags(kind, Code::FIELD, extra_state,
622 cache_holder, argc); 625 cache_holder, argc);
623 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 626 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
624 isolate_); 627 isolate_);
625 if (probe->IsCode()) return Handle<Code>::cast(probe); 628 if (probe->IsCode()) return Handle<Code>::cast(probe);
626 629
(...skipping 17 matching lines...) Expand all
644 Handle<Object> object, 647 Handle<Object> object,
645 Handle<JSObject> holder) { 648 Handle<JSObject> holder) {
646 // Compute the check type and the map. 649 // Compute the check type and the map.
647 InlineCacheHolderFlag cache_holder = 650 InlineCacheHolderFlag cache_holder =
648 IC::GetCodeCacheForObject(*object, *holder); 651 IC::GetCodeCacheForObject(*object, *holder);
649 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); 652 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder));
650 653
651 // TODO(1233596): We cannot do receiver map check for non-JS objects 654 // TODO(1233596): We cannot do receiver map check for non-JS objects
652 // because they may be represented as immediates without a 655 // because they may be represented as immediates without a
653 // map. Instead, we check against the map in the holder. 656 // map. Instead, we check against the map in the holder.
654 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { 657 if (object->IsNumber() || object->IsSymbol() ||
658 object->IsBoolean() || object->IsString()) {
655 object = holder; 659 object = holder;
656 } 660 }
657 661
658 Code::Flags flags = 662 Code::Flags flags =
659 Code::ComputeMonomorphicFlags(kind, Code::INTERCEPTOR, extra_state, 663 Code::ComputeMonomorphicFlags(kind, Code::INTERCEPTOR, extra_state,
660 cache_holder, argc); 664 cache_holder, argc);
661 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 665 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
662 isolate_); 666 isolate_);
663 if (probe->IsCode()) return Handle<Code>::cast(probe); 667 if (probe->IsCode()) return Handle<Code>::cast(probe);
664 668
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 Handle<FunctionTemplateInfo>( 1758 Handle<FunctionTemplateInfo>(
1755 FunctionTemplateInfo::cast(signature->receiver())); 1759 FunctionTemplateInfo::cast(signature->receiver()));
1756 } 1760 }
1757 } 1761 }
1758 1762
1759 is_simple_api_call_ = true; 1763 is_simple_api_call_ = true;
1760 } 1764 }
1761 1765
1762 1766
1763 } } // namespace v8::internal 1767 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698