Reviewers: Toon Verwaest,
Message:
Committed patchset #1 manually as r18845 (presubmit successful).
Description:
Fix issue with context not being saved on x64 introduced in 144543004
[email protected]
BUG=
Committed: https://code.google.com/p/v8/source/detail?r=18845
Please review this at https://codereview.chromium.org/143333003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+15, -1 lines):
M src/x64/stub-cache-x64.cc
M test/cctest/test-accessors.cc
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index
dbfd419290c692b61758bacb58d9e76dcea55668..b579e94e7b72e61a9b400c711542c49b790a95f1
100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -521,6 +521,7 @@ static void GenerateFastApiCallBody(MacroAssembler*
masm,
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();
Index: test/cctest/test-accessors.cc
diff --git a/test/cctest/test-accessors.cc b/test/cctest/test-accessors.cc
index
cbbdc507cc79f4b7646916c9fbcbb954c523e5e8..a3ce5c37ec8f10feb0d62d7b57e7b905d9f6b376
100644
--- a/test/cctest/test-accessors.cc
+++ b/test/cctest/test-accessors.cc
@@ -580,14 +580,27 @@ THREADED_TEST(JSONStringifyNamedInterceptorObject) {
}
+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.