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

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

Issue 2715004: [Isolates]... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Address comments/make StackGuard::ThreadLocal::Initialize/Clear side-effects visible Created 10 years, 6 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
OLDNEW
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-2009 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 9935 matching lines...) Expand 10 before | Expand all | Expand 10 after
9946 if (rv) 9946 if (rv)
9947 break; 9947 break;
9948 } 9948 }
9949 CHECK(rv == true); 9949 CHECK(rv == true);
9950 } 9950 }
9951 9951
9952 9952
9953 static uint32_t* stack_limit; 9953 static uint32_t* stack_limit;
9954 9954
9955 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) { 9955 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) {
9956 stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::climit()); 9956 stack_limit = reinterpret_cast<uint32_t*>(
9957 i::Isolate::Current()->stack_guard()->climit());
9957 return v8::Undefined(); 9958 return v8::Undefined();
9958 } 9959 }
9959 9960
9960 9961
9961 // Uses the address of a local variable to determine the stack top now. 9962 // Uses the address of a local variable to determine the stack top now.
9962 // Given a size, returns an address that is that far from the current 9963 // Given a size, returns an address that is that far from the current
9963 // top of stack. 9964 // top of stack.
9964 static uint32_t* ComputeStackLimit(uint32_t size) { 9965 static uint32_t* ComputeStackLimit(uint32_t size) {
9965 uint32_t* answer = &size - (size / sizeof(size)); 9966 uint32_t* answer = &size - (size / sizeof(size));
9966 // If the size is very large and the stack is very near the bottom of 9967 // If the size is very large and the stack is very near the bottom of
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
10619 const char* code = 10620 const char* code =
10620 "(function() {" 10621 "(function() {"
10621 " for (var i = 0; i < 2*16; i++) {" 10622 " for (var i = 0; i < 2*16; i++) {"
10622 " %_GetFromCache(0, 'a' + i);" 10623 " %_GetFromCache(0, 'a' + i);"
10623 " };" 10624 " };"
10624 " return 'PASSED';" 10625 " return 'PASSED';"
10625 "})()"; 10626 "})()";
10626 v8::internal::Heap::ClearJSFunctionResultCaches(); 10627 v8::internal::Heap::ClearJSFunctionResultCaches();
10627 ExpectString(code, "PASSED"); 10628 ExpectString(code, "PASSED");
10628 } 10629 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698