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

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

Issue 140943002: Fix logic error in assert in IsUndeclaredGlobal() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few more fixes Created 6 years, 11 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
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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, so we
887 // can't use either LoadIC or KeyedLoadIC constructors. 887 // can't use either LoadIC or KeyedLoadIC constructors.
888 HandleScope scope(isolate); 888 HandleScope scope(isolate);
889 IC ic(IC::NO_EXTRA_FRAME, isolate); 889 IC ic(IC::NO_EXTRA_FRAME, isolate);
890 ASSERT(ic.IsLoadStub()); 890 ASSERT(ic.IsLoadStub());
891 if (!ic.IsContextual()) { 891 if (!ic.IsContextualLoad()) {
892 return isolate->heap()->undefined_value(); 892 return isolate->heap()->undefined_value();
893 } 893 }
894 894
895 // Throw a reference error. 895 // Throw a reference error.
896 Handle<Name> name_handle(name); 896 Handle<Name> name_handle(name);
897 Handle<Object> error = 897 Handle<Object> error =
898 isolate->factory()->NewReferenceError("not_defined", 898 isolate->factory()->NewReferenceError("not_defined",
899 HandleVector(&name_handle, 1)); 899 HandleVector(&name_handle, 1));
900 return isolate->Throw(*error); 900 return isolate->Throw(*error);
901 } 901 }
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 *code, code->arguments_count())); 1040 *code, code->arguments_count()));
1041 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code)); 1041 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, *code));
1042 return code; 1042 return code;
1043 } 1043 }
1044 1044
1045 1045
1046 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) { 1046 Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) {
1047 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1047 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1048 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1048 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1049 if (kind == Code::CALL_IC) { 1049 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); 1050 CallIC::GenerateNormal(masm(), argc);
1054 } else { 1051 } else {
1055 KeyedCallIC::GenerateNormal(masm(), argc); 1052 KeyedCallIC::GenerateNormal(masm(), argc);
1056 } 1053 }
1057 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal"); 1054 Handle<Code> code = GetCodeWithFlags(flags, "CompileCallNormal");
1058 isolate()->counters()->call_normal_stubs()->Increment(); 1055 isolate()->counters()->call_normal_stubs()->Increment();
1059 PROFILE(isolate(), 1056 PROFILE(isolate(),
1060 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), 1057 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG),
1061 *code, code->arguments_count())); 1058 *code, code->arguments_count()));
1062 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code)); 1059 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, *code));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic"); 1095 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadPreMonomorphic");
1099 PROFILE(isolate(), 1096 PROFILE(isolate(),
1100 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0)); 1097 CodeCreateEvent(Logger::LOAD_PREMONOMORPHIC_TAG, *code, 0));
1101 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); 1098 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code));
1102 return code; 1099 return code;
1103 } 1100 }
1104 1101
1105 1102
1106 Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) { 1103 Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) {
1107 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags); 1104 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
1108 ContextualMode mode = IC::GetContextualMode(extra_state); 1105 ContextualMode mode = LoadIC::GetContextualMode(extra_state);
1109 LoadIC::GenerateMegamorphic(masm(), mode); 1106 LoadIC::GenerateMegamorphic(masm(), mode);
1110 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic"); 1107 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic");
1111 PROFILE(isolate(), 1108 PROFILE(isolate(),
1112 CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0)); 1109 CodeCreateEvent(Logger::LOAD_MEGAMORPHIC_TAG, *code, 0));
1113 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code)); 1110 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *code));
1114 return code; 1111 return code;
1115 } 1112 }
1116 1113
1117 1114
1118 Handle<Code> StubCompiler::CompileStoreInitialize(Code::Flags flags) { 1115 Handle<Code> StubCompiler::CompileStoreInitialize(Code::Flags flags) {
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 Handle<FunctionTemplateInfo>( 2026 Handle<FunctionTemplateInfo>(
2030 FunctionTemplateInfo::cast(signature->receiver())); 2027 FunctionTemplateInfo::cast(signature->receiver()));
2031 } 2028 }
2032 } 2029 }
2033 2030
2034 is_simple_api_call_ = true; 2031 is_simple_api_call_ = true;
2035 } 2032 }
2036 2033
2037 2034
2038 } } // namespace v8::internal 2035 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698