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

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

Issue 12040039: Always fail when trying to store to an undeclared global variable, even if it was found. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test to check for the exact reference error. Created 7 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
« no previous file with comments | « src/ic.cc ('k') | test/cctest/cctest.gyp » ('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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 return isolate->heap()->no_interceptor_result_sentinel(); 1064 return isolate->heap()->no_interceptor_result_sentinel();
1065 } 1065 }
1066 1066
1067 1067
1068 static MaybeObject* ThrowReferenceError(String* name) { 1068 static MaybeObject* ThrowReferenceError(String* name) {
1069 // If the load is non-contextual, just return the undefined result. 1069 // If the load is non-contextual, just return the undefined result.
1070 // Note that both keyed and non-keyed loads may end up here, so we 1070 // Note that both keyed and non-keyed loads may end up here, so we
1071 // can't use either LoadIC or KeyedLoadIC constructors. 1071 // can't use either LoadIC or KeyedLoadIC constructors.
1072 IC ic(IC::NO_EXTRA_FRAME, Isolate::Current()); 1072 IC ic(IC::NO_EXTRA_FRAME, Isolate::Current());
1073 ASSERT(ic.target()->is_load_stub() || ic.target()->is_keyed_load_stub()); 1073 ASSERT(ic.target()->is_load_stub() || ic.target()->is_keyed_load_stub());
1074 if (!ic.SlowIsContextual()) return HEAP->undefined_value(); 1074 if (!ic.SlowIsUndeclaredGlobal()) return HEAP->undefined_value();
1075 1075
1076 // Throw a reference error. 1076 // Throw a reference error.
1077 HandleScope scope; 1077 HandleScope scope;
1078 Handle<String> name_handle(name); 1078 Handle<String> name_handle(name);
1079 Handle<Object> error = 1079 Handle<Object> error =
1080 FACTORY->NewReferenceError("not_defined", 1080 FACTORY->NewReferenceError("not_defined",
1081 HandleVector(&name_handle, 1)); 1081 HandleVector(&name_handle, 1));
1082 return Isolate::Current()->Throw(*error); 1082 return Isolate::Current()->Throw(*error);
1083 } 1083 }
1084 1084
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 Handle<FunctionTemplateInfo>( 1643 Handle<FunctionTemplateInfo>(
1644 FunctionTemplateInfo::cast(signature->receiver())); 1644 FunctionTemplateInfo::cast(signature->receiver()));
1645 } 1645 }
1646 } 1646 }
1647 1647
1648 is_simple_api_call_ = true; 1648 is_simple_api_call_ = true;
1649 } 1649 }
1650 1650
1651 1651
1652 } } // namespace v8::internal 1652 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698