OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
690 .IsJust()); | 690 .IsJust()); |
691 return *object; | 691 return *object; |
692 } | 692 } |
693 | 693 |
694 RUNTIME_FUNCTION(Runtime_CollectTypeProfile) { | 694 RUNTIME_FUNCTION(Runtime_CollectTypeProfile) { |
695 HandleScope scope(isolate); | 695 HandleScope scope(isolate); |
696 DCHECK_EQ(4, args.length()); | 696 DCHECK_EQ(4, args.length()); |
697 CONVERT_ARG_HANDLE_CHECKED(Smi, position, 0); | 697 CONVERT_ARG_HANDLE_CHECKED(Smi, position, 0); |
698 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | 698 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
699 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 2); | 699 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 2); |
700 CONVERT_SMI_ARG_CHECKED(index, 3); | 700 CONVERT_SMI_ARG_CHECKED(index, 3); |
Yang
2017/03/22 09:43:06
Do I understand correctly that this index is actua
| |
701 | 701 |
702 DCHECK(FLAG_type_profile); | 702 DCHECK(FLAG_type_profile); |
703 | 703 |
704 Handle<Name> type = Object::TypeOf(isolate, value); | 704 Handle<Name> type = Object::TypeOf(isolate, value); |
705 if (value->IsJSReceiver()) { | 705 if (value->IsJSReceiver()) { |
706 Handle<JSReceiver> object = Handle<JSReceiver>::cast(value); | 706 Handle<JSReceiver> object = Handle<JSReceiver>::cast(value); |
707 type = JSReceiver::GetConstructorName(object); | 707 type = JSReceiver::GetConstructorName(object); |
708 } | 708 } |
709 | 709 |
710 DCHECK(!vector->ToSlot(index).IsInvalid()); | |
710 CollectTypeProfileNexus nexus(vector, vector->ToSlot(index)); | 711 CollectTypeProfileNexus nexus(vector, vector->ToSlot(index)); |
711 nexus.Collect(type, position->value()); | 712 nexus.Collect(type, position->value()); |
712 | 713 |
713 return isolate->heap()->undefined_value(); | 714 return isolate->heap()->undefined_value(); |
714 } | 715 } |
715 | 716 |
716 // Return property without being observable by accessors or interceptors. | 717 // Return property without being observable by accessors or interceptors. |
717 RUNTIME_FUNCTION(Runtime_GetDataProperty) { | 718 RUNTIME_FUNCTION(Runtime_GetDataProperty) { |
718 HandleScope scope(isolate); | 719 HandleScope scope(isolate); |
719 DCHECK_EQ(2, args.length()); | 720 DCHECK_EQ(2, args.length()); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1017 if (!success) return isolate->heap()->exception(); | 1018 if (!success) return isolate->heap()->exception(); |
1018 MAYBE_RETURN( | 1019 MAYBE_RETURN( |
1019 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 1020 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
1020 isolate->heap()->exception()); | 1021 isolate->heap()->exception()); |
1021 return *value; | 1022 return *value; |
1022 } | 1023 } |
1023 | 1024 |
1024 | 1025 |
1025 } // namespace internal | 1026 } // namespace internal |
1026 } // namespace v8 | 1027 } // namespace v8 |
OLD | NEW |