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

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

Issue 6794019: Simplify isolates access during stack iteration (WAS: Move SafeStackFrameIterator::active_count_...) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A couple more changes Created 9 years, 8 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
« src/frames-inl.h ('K') | « src/v8threads.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 "}"))->Run(); 390 "}"))->Run();
391 } 391 }
392 392
393 393
394 static v8::Handle<Value> StackCheck(Local<String> name, 394 static v8::Handle<Value> StackCheck(Local<String> name,
395 const AccessorInfo& info) { 395 const AccessorInfo& info) {
396 i::StackFrameIterator iter; 396 i::StackFrameIterator iter;
397 for (int i = 0; !iter.done(); i++) { 397 for (int i = 0; !iter.done(); i++) {
398 i::StackFrame* frame = iter.frame(); 398 i::StackFrame* frame = iter.frame();
399 CHECK(i != 0 || (frame->type() == i::StackFrame::EXIT)); 399 CHECK(i != 0 || (frame->type() == i::StackFrame::EXIT));
400 i::Code* code = frame->LookupCode(i::Isolate::Current()); 400 i::Code* code = frame->LookupCode();
401 CHECK(code->IsCode()); 401 CHECK(code->IsCode());
402 i::Address pc = frame->pc(); 402 i::Address pc = frame->pc();
403 CHECK(code->contains(pc)); 403 CHECK(code->contains(pc));
404 iter.Advance(); 404 iter.Advance();
405 } 405 }
406 return v8::Undefined(); 406 return v8::Undefined();
407 } 407 }
408 408
409 409
410 THREADED_TEST(StackIteration) { 410 THREADED_TEST(StackIteration) {
(...skipping 30 matching lines...) Expand all
441 obj->SetAccessor(v8_str("xxx"), AllocateHandles); 441 obj->SetAccessor(v8_str("xxx"), AllocateHandles);
442 LocalContext env; 442 LocalContext env;
443 env->Global()->Set(v8_str("obj"), obj->NewInstance()); 443 env->Global()->Set(v8_str("obj"), obj->NewInstance());
444 v8::Handle<v8::Value> result = Script::Compile(String::New( 444 v8::Handle<v8::Value> result = Script::Compile(String::New(
445 "var result;" 445 "var result;"
446 "for (var i = 0; i < 4; i++)" 446 "for (var i = 0; i < 4; i++)"
447 " result = obj.xxx;" 447 " result = obj.xxx;"
448 "result;"))->Run(); 448 "result;"))->Run();
449 CHECK_EQ(100, result->Int32Value()); 449 CHECK_EQ(100, result->Int32Value());
450 } 450 }
OLDNEW
« src/frames-inl.h ('K') | « src/v8threads.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698