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

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

Issue 5188006: Push version 2.5.7 to trunk.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 1 month 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/SConscript ('k') | test/cctest/test-bignum-dtoa.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 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 20 matching lines...) Expand all
31 31
32 #include "api.h" 32 #include "api.h"
33 #include "compilation-cache.h" 33 #include "compilation-cache.h"
34 #include "execution.h" 34 #include "execution.h"
35 #include "snapshot.h" 35 #include "snapshot.h"
36 #include "platform.h" 36 #include "platform.h"
37 #include "top.h" 37 #include "top.h"
38 #include "utils.h" 38 #include "utils.h"
39 #include "cctest.h" 39 #include "cctest.h"
40 #include "parser.h" 40 #include "parser.h"
41 #include "unicode-inl.h"
41 42
42 static const bool kLogThreading = true; 43 static const bool kLogThreading = true;
43 44
44 static bool IsNaN(double x) { 45 static bool IsNaN(double x) {
45 #ifdef WIN32 46 #ifdef WIN32
46 return _isnan(x); 47 return _isnan(x);
47 #else 48 #else
48 return isnan(x); 49 return isnan(x);
49 #endif 50 #endif
50 } 51 }
(...skipping 10571 matching lines...) Expand 10 before | Expand all | Expand 10 after
10622 if (rv) 10623 if (rv)
10623 break; 10624 break;
10624 } 10625 }
10625 CHECK(rv == true); 10626 CHECK(rv == true);
10626 } 10627 }
10627 10628
10628 10629
10629 static uint32_t* stack_limit; 10630 static uint32_t* stack_limit;
10630 10631
10631 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) { 10632 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) {
10632 stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::climit()); 10633 stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::real_climit());
10633 return v8::Undefined(); 10634 return v8::Undefined();
10634 } 10635 }
10635 10636
10636 10637
10637 // Uses the address of a local variable to determine the stack top now. 10638 // Uses the address of a local variable to determine the stack top now.
10638 // Given a size, returns an address that is that far from the current 10639 // Given a size, returns an address that is that far from the current
10639 // top of stack. 10640 // top of stack.
10640 static uint32_t* ComputeStackLimit(uint32_t size) { 10641 static uint32_t* ComputeStackLimit(uint32_t size) {
10641 uint32_t* answer = &size - (size / sizeof(size)); 10642 uint32_t* answer = &size - (size / sizeof(size));
10642 // If the size is very large and the stack is very near the bottom of 10643 // If the size is very large and the stack is very near the bottom of
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
11764 v8::Context::Scope context_scope(context.local()); 11765 v8::Context::Scope context_scope(context.local());
11765 11766
11766 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); 11767 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
11767 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); 11768 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator);
11768 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); 11769 context->Global()->Set(v8_str("o"), tmpl->NewInstance());
11769 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( 11770 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun(
11770 "var result = []; for (var k in o) result.push(k); result")); 11771 "var result = []; for (var k in o) result.push(k); result"));
11771 CHECK_EQ(1, result->Length()); 11772 CHECK_EQ(1, result->Length());
11772 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); 11773 CHECK_EQ(v8_str("universalAnswer"), result->Get(0));
11773 } 11774 }
OLDNEW
« no previous file with comments | « test/cctest/SConscript ('k') | test/cctest/test-bignum-dtoa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698