OLD | NEW |
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 10611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10622 if (rv) | 10622 if (rv) |
10623 break; | 10623 break; |
10624 } | 10624 } |
10625 CHECK(rv == true); | 10625 CHECK(rv == true); |
10626 } | 10626 } |
10627 | 10627 |
10628 | 10628 |
10629 static uint32_t* stack_limit; | 10629 static uint32_t* stack_limit; |
10630 | 10630 |
10631 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) { | 10631 static v8::Handle<Value> GetStackLimitCallback(const v8::Arguments& args) { |
10632 stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::climit()); | 10632 stack_limit = reinterpret_cast<uint32_t*>(i::StackGuard::real_climit()); |
10633 return v8::Undefined(); | 10633 return v8::Undefined(); |
10634 } | 10634 } |
10635 | 10635 |
10636 | 10636 |
10637 // Uses the address of a local variable to determine the stack top now. | 10637 // 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 | 10638 // Given a size, returns an address that is that far from the current |
10639 // top of stack. | 10639 // top of stack. |
10640 static uint32_t* ComputeStackLimit(uint32_t size) { | 10640 static uint32_t* ComputeStackLimit(uint32_t size) { |
10641 uint32_t* answer = &size - (size / sizeof(size)); | 10641 uint32_t* answer = &size - (size / sizeof(size)); |
10642 // If the size is very large and the stack is very near the bottom of | 10642 // 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 Loading... |
11764 v8::Context::Scope context_scope(context.local()); | 11764 v8::Context::Scope context_scope(context.local()); |
11765 | 11765 |
11766 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); | 11766 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); |
11767 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); | 11767 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); |
11768 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); | 11768 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); |
11769 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( | 11769 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( |
11770 "var result = []; for (var k in o) result.push(k); result")); | 11770 "var result = []; for (var k in o) result.push(k); result")); |
11771 CHECK_EQ(1, result->Length()); | 11771 CHECK_EQ(1, result->Length()); |
11772 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); | 11772 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); |
11773 } | 11773 } |
OLD | NEW |