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

Side by Side Diff: test/cctest/test-platform.cc

Issue 124943004: Prepare removal of ObjectTemplate::New without Isolate parameter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Do not remove ObjectTemplate::New() yet. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-object-observe.cc ('k') | test/cctest/test-thread-termination.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) { 66 void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) {
67 GET_STACK_POINTER(); 67 GET_STACK_POINTER();
68 args.GetReturnValue().Set(v8_num(sp_addr)); 68 args.GetReturnValue().Set(v8_num(sp_addr));
69 } 69 }
70 70
71 71
72 TEST(StackAlignment) { 72 TEST(StackAlignment) {
73 v8::Isolate* isolate = CcTest::isolate(); 73 v8::Isolate* isolate = CcTest::isolate();
74 v8::HandleScope handle_scope(isolate); 74 v8::HandleScope handle_scope(isolate);
75 v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); 75 v8::Handle<v8::ObjectTemplate> global_template =
76 v8::ObjectTemplate::New(isolate);
76 global_template->Set(v8_str("get_stack_pointer"), 77 global_template->Set(v8_str("get_stack_pointer"),
77 v8::FunctionTemplate::New(isolate, GetStackPointer)); 78 v8::FunctionTemplate::New(isolate, GetStackPointer));
78 79
79 LocalContext env(NULL, global_template); 80 LocalContext env(NULL, global_template);
80 CompileRun( 81 CompileRun(
81 "function foo() {" 82 "function foo() {"
82 " return get_stack_pointer();" 83 " return get_stack_pointer();"
83 "}"); 84 "}");
84 85
85 v8::Local<v8::Object> global_object = env->Global(); 86 v8::Local<v8::Object> global_object = env->Global();
86 v8::Local<v8::Function> foo = 87 v8::Local<v8::Function> foo =
87 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); 88 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
88 89
89 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL); 90 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL);
90 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment()); 91 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment());
91 } 92 }
92 93
93 #undef GET_STACK_POINTERS 94 #undef GET_STACK_POINTERS
94 #undef ASM 95 #undef ASM
95 #endif // __GNUC__ 96 #endif // __GNUC__
OLDNEW
« no previous file with comments | « test/cctest/test-object-observe.cc ('k') | test/cctest/test-thread-termination.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698