OLD | NEW |
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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 return *v8::Utils::OpenHandle(*r); | 876 return *v8::Utils::OpenHandle(*r); |
877 } | 877 } |
878 } | 878 } |
879 | 879 |
880 return isolate->heap()->no_interceptor_result_sentinel(); | 880 return isolate->heap()->no_interceptor_result_sentinel(); |
881 } | 881 } |
882 | 882 |
883 | 883 |
884 static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) { | 884 static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) { |
885 // If the load is non-contextual, just return the undefined result. | 885 // If the load is non-contextual, just return the undefined result. |
886 // Note that both keyed and non-keyed loads may end up here, so we | 886 // Note that both keyed and non-keyed loads may end up here. |
887 // can't use either LoadIC or KeyedLoadIC constructors. | |
888 HandleScope scope(isolate); | 887 HandleScope scope(isolate); |
889 IC ic(IC::NO_EXTRA_FRAME, isolate); | 888 LoadIC ic(IC::NO_EXTRA_FRAME, isolate); |
890 ASSERT(ic.IsLoadStub()); | 889 if (ic.contextual_mode() != CONTEXTUAL) { |
891 if (!ic.IsContextual()) { | |
892 return isolate->heap()->undefined_value(); | 890 return isolate->heap()->undefined_value(); |
893 } | 891 } |
894 | 892 |
895 // Throw a reference error. | 893 // Throw a reference error. |
896 Handle<Name> name_handle(name); | 894 Handle<Name> name_handle(name); |
897 Handle<Object> error = | 895 Handle<Object> error = |
898 isolate->factory()->NewReferenceError("not_defined", | 896 isolate->factory()->NewReferenceError("not_defined", |
899 HandleVector(&name_handle, 1)); | 897 HandleVector(&name_handle, 1)); |
900 return isolate->Throw(*error); | 898 return isolate->Throw(*error); |
901 } | 899 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 *code, code->arguments_count())); | 1038 *code, code->arguments_count())); |
1041 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code)); | 1039 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code)); |
1042 return code; | 1040 return code; |
1043 } | 1041 } |
1044 | 1042 |
1045 | 1043 |
1046 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) { | 1044 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) { |
1047 int argc = Code::ExtractArgumentsCountFromFlags(flags); | 1045 int argc = Code::ExtractArgumentsCountFromFlags(flags); |
1048 Code::Kind kind = Code::ExtractKindFromFlags(flags); | 1046 Code::Kind kind = Code::ExtractKindFromFlags(flags); |
1049 if (kind == Code::CALL_IC) { | 1047 if (kind == Code::CALL_IC) { |
1050 // Call normal is always with a explict receiver. | |
1051 ASSERT(!CallIC::Contextual::decode( | |
1052 Code::ExtractExtraICStateFromFlags(flags))); | |
1053 CallIC::GenerateNormal(masm(), argc); | 1048 CallIC::GenerateNormal(masm(), argc); |
1054 } else { | 1049 } else { |
1055 KeyedCallIC::GenerateNormal(masm(), argc); | 1050 KeyedCallIC::GenerateNormal(masm(), argc); |
1056 } | 1051 } |
1057 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal"); | 1052 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal"); |
1058 isolate()->counters()->call_normal_stubs()->Increment(); | 1053 isolate()->counters()->call_normal_stubs()->Increment(); |
1059 PROFILE(isolate(), | 1054 PROFILE(isolate(), |
1060 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), | 1055 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), |
1061 *code, code->arguments_count())); | 1056 *code, code->arguments_count())); |
1062 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code)); | 1057 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic"); | 1093 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic"); |
1099 PROFILE(isolate(), | 1094 PROFILE(isolate(), |
1100 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0)); | 1095 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0)); |
1101 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); | 1096 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); |
1102 return code; | 1097 return code; |
1103 } | 1098 } |
1104 | 1099 |
1105 | 1100 |
1106 Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) { | 1101 Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) { |
1107 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); | 1102 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); |
1108 ContextualMode mode = IC::GetContextualMode(extra_state); | 1103 ContextualMode mode = LoadIC::GetContextualMode(extra_state); |
1109 LoadIC::GenerateMegamorphic(masm(), mode); | 1104 LoadIC::GenerateMegamorphic(masm(), mode); |
1110 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic"); | 1105 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic"); |
1111 PROFILE(isolate(), | 1106 PROFILE(isolate(), |
1112 CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0)); | 1107 CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0)); |
1113 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); | 1108 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); |
1114 return code; | 1109 return code; |
1115 } | 1110 } |
1116 | 1111 |
1117 | 1112 |
1118 Handle<Code> StubCompiler::CompileStoreInitialize(Code::Flags flags) { | 1113 Handle<Code> StubCompiler::CompileStoreInitialize(Code::Flags flags) { |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2029 Handle<FunctionTemplateInfo>( | 2024 Handle<FunctionTemplateInfo>( |
2030 FunctionTemplateInfo::cast(signature->receiver())); | 2025 FunctionTemplateInfo::cast(signature->receiver())); |
2031 } | 2026 } |
2032 } | 2027 } |
2033 | 2028 |
2034 is_simple_api_call_ = true; | 2029 is_simple_api_call_ = true; |
2035 } | 2030 } |
2036 | 2031 |
2037 | 2032 |
2038 } } // namespace v8::internal | 2033 } } // namespace v8::internal |
OLD | NEW |