Revision: 18845
Author:   [email protected]
Date:     Mon Jan 27 08:12:59 2014 UTC
Log: Fix issue with context not being saved on x64 introduced in 144543004

[email protected]

BUG=

Review URL: https://codereview.chromium.org/143333003
http://code.google.com/p/v8/source/detail?r=18845

Modified:
 /branches/bleeding_edge/src/x64/stub-cache-x64.cc
 /branches/bleeding_edge/test/cctest/test-accessors.cc

=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Fri Jan 24 11:47:53 2014 UTC +++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Mon Jan 27 08:12:59 2014 UTC
@@ -521,6 +521,7 @@
   Handle<JSFunction> function = optimization.constant_function();
   __ Move(scratch2, function);
   __ push(scratch2);
+  __ movp(rsi, FieldOperand(scratch2, JSFunction::kContextOffset));

   Isolate* isolate = masm->isolate();
   Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
=======================================
--- /branches/bleeding_edge/test/cctest/test-accessors.cc Wed Jan 8 06:53:31 2014 UTC +++ /branches/bleeding_edge/test/cctest/test-accessors.cc Mon Jan 27 08:12:59 2014 UTC
@@ -578,16 +578,29 @@
v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}");
   CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected));
 }
+
+
+static v8::Local<v8::Context> expected_current_context;
+static v8::Local<v8::Context> expected_calling_context;
+
+
+static void check_contexts(const v8::FunctionCallbackInfo<v8::Value>& info) {
+  ApiTestFuzzer::Fuzz();
+ CHECK(expected_current_context == info.GetIsolate()->GetCurrentContext()); + CHECK(expected_calling_context == info.GetIsolate()->GetCallingContext());
+}


 THREADED_TEST(AccessorPropertyCrossContext) {
   LocalContext env;
   v8::Isolate* isolate = env->GetIsolate();
   v8::HandleScope scope(isolate);
- v8::Handle<v8::Function> fun = v8::Function::New(isolate, handle_property); + v8::Handle<v8::Function> fun = v8::Function::New(isolate, check_contexts);
   LocalContext switch_context;
   switch_context->Global()->Set(v8_str("fun"), fun);
   v8::TryCatch try_catch;
+  expected_current_context = env.local();
+  expected_calling_context = switch_context.local();
   CompileRun(
       "var o = Object.create(null, { n: { get:fun } });"
       "for (var i = 0; i < 10; i++) o.n;");

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to