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

Unified Diff: src/runtime.cc

Issue 131663003: Make the strict-mode calling convention for contextual calls the default one. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix arm port 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 7a2d46c4b4315a96ad86ef7cb8c79458fef66b9b..7db68b4191a4f8232d56c057d8ac8bc1332c88fa 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -9170,9 +9170,8 @@ static Object* ComputeReceiverForNonGlobal(Isolate* isolate,
if (constructor != context_extension_function) return holder;
// Fall back to using the global object as the implicit receiver if
// the property turns out to be a local variable allocated in a
- // context extension object - introduced via eval. Implicit global
- // receivers are indicated with the hole value.
- return isolate->heap()->the_hole_value();
+ // context extension object - introduced via eval.
+ return isolate->heap()->undefined_value();
}
@@ -9206,11 +9205,7 @@ static ObjectPair LoadContextSlotHelper(Arguments args,
ASSERT(holder->IsContext());
// If the "property" we were looking for is a local variable, the
// receiver is the global object; see ECMA-262, 3rd., 10.1.6 and 10.2.3.
- //
- // Use the hole as the receiver to signal that the receiver is implicit
- // and that the global receiver should be used (as distinguished from an
- // explicit receiver that happens to be a global object).
- Handle<Object> receiver = isolate->factory()->the_hole_value();
+ Handle<Object> receiver = isolate->factory()->undefined_value();
Object* value = Context::cast(*holder)->get(index);
// Check for uninitialized bindings.
switch (binding_flags) {
@@ -9245,7 +9240,7 @@ static ObjectPair LoadContextSlotHelper(Arguments args,
// GetProperty below can cause GC.
Handle<Object> receiver_handle(
object->IsGlobalObject()
- ? Object::cast(isolate->heap()->the_hole_value())
+ ? Object::cast(isolate->heap()->undefined_value())
: object->IsJSProxy() ? static_cast<Object*>(*object)
: ComputeReceiverForNonGlobal(isolate, JSObject::cast(*object)),
isolate);
@@ -9744,7 +9739,7 @@ RUNTIME_FUNCTION(ObjectPair, Runtime_ResolvePossiblyDirectEval) {
// the first argument without doing anything).
if (*callee != isolate->native_context()->global_eval_fun() ||
!args[1]->IsString()) {
- return MakePair(*callee, isolate->heap()->the_hole_value());
+ return MakePair(*callee, isolate->heap()->undefined_value());
}
CONVERT_LANGUAGE_MODE_ARG(language_mode, 3);
@@ -11336,11 +11331,15 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFrameDetails) {
// by creating correct wrapper object based on the calling frame's
// native context.
it.Advance();
- Handle<Context> calling_frames_native_context(
- Context::cast(Context::cast(it.frame()->context())->native_context()));
- ASSERT(!receiver->IsUndefined() && !receiver->IsNull());
- receiver =
- isolate->factory()->ToObject(receiver, calling_frames_native_context);
+ if (receiver->IsUndefined()) {
+ Context* context = function->context();
+ receiver = handle(context->global_object()->global_receiver());
+ } else {
+ ASSERT(!receiver->IsNull());
+ Context* context = Context::cast(it.frame()->context());
+ Handle<Context> native_context(Context::cast(context->native_context()));
+ receiver = isolate->factory()->ToObject(receiver, native_context);
+ }
}
details->set(kFrameDetailsReceiverIndex, *receiver);
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698