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

Unified Diff: src/runtime.cc

Issue 6815029: Merge (7180:7265] from bleeding_edge to the experimental/gc branch.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profile-generator.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 7557)
+++ src/runtime.cc (working copy)
@@ -4380,7 +4380,15 @@
// Handle special arguments properties.
if (key->Equals(Heap::length_symbol())) return Smi::FromInt(n);
- if (key->Equals(Heap::callee_symbol())) return frame->function();
+ if (key->Equals(Heap::callee_symbol())) {
+ Object* function = frame->function();
+ if (function->IsJSFunction() &&
+ JSFunction::cast(function)->shared()->strict_mode()) {
+ return Top::Throw(*Factory::NewTypeError("strict_arguments_callee",
+ HandleVector<Object>(NULL, 0)));
+ }
+ return function;
+ }
// Lookup in the initial Object.prototype object.
return Top::initial_object_prototype()->GetProperty(*key);
@@ -8051,11 +8059,14 @@
HandleScope scope;
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, func, 0);
- ASSERT(func->map()->instance_type() ==
- Top::function_instance_map()->instance_type());
- ASSERT(func->map()->instance_size() ==
- Top::function_instance_map()->instance_size());
- func->set_map(*Top::function_instance_map());
+
+ Handle<Map> map = func->shared()->strict_mode()
+ ? Top::strict_mode_function_instance_map()
+ : Top::function_instance_map();
+
+ ASSERT(func->map()->instance_type() == map->instance_type());
+ ASSERT(func->map()->instance_size() == map->instance_size());
+ func->set_map(*map);
return *func;
}
« no previous file with comments | « src/profile-generator.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698