OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 "for (var i = 0; i < 2048; i++) {" | 391 "for (var i = 0; i < 2048; i++) {" |
392 " var result = obj.xxx;" | 392 " var result = obj.xxx;" |
393 " result[0] = last;" | 393 " result[0] = last;" |
394 " last = result;" | 394 " last = result;" |
395 "}"))->Run(); | 395 "}"))->Run(); |
396 } | 396 } |
397 | 397 |
398 | 398 |
399 static v8::Handle<Value> StackCheck(Local<String> name, | 399 static v8::Handle<Value> StackCheck(Local<String> name, |
400 const AccessorInfo& info) { | 400 const AccessorInfo& info) { |
401 i::StackFrameIterator iter; | 401 i::StackFrameIterator iter(reinterpret_cast<i::Isolate*>(info.GetIsolate())); |
402 for (int i = 0; !iter.done(); i++) { | 402 for (int i = 0; !iter.done(); i++) { |
403 i::StackFrame* frame = iter.frame(); | 403 i::StackFrame* frame = iter.frame(); |
404 CHECK(i != 0 || (frame->type() == i::StackFrame::EXIT)); | 404 CHECK(i != 0 || (frame->type() == i::StackFrame::EXIT)); |
405 i::Code* code = frame->LookupCode(); | 405 i::Code* code = frame->LookupCode(); |
406 CHECK(code->IsCode()); | 406 CHECK(code->IsCode()); |
407 i::Address pc = frame->pc(); | 407 i::Address pc = frame->pc(); |
408 CHECK(code->contains(pc)); | 408 CHECK(code->contains(pc)); |
409 iter.Advance(); | 409 iter.Advance(); |
410 } | 410 } |
411 return v8::Undefined(); | 411 return v8::Undefined(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 v8::HandleScope scope; | 472 v8::HandleScope scope; |
473 LocalContext env; | 473 LocalContext env; |
474 | 474 |
475 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 475 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
476 obj->SetNamedPropertyHandler( | 476 obj->SetNamedPropertyHandler( |
477 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); | 477 JSONStringifyGetter, NULL, NULL, NULL, JSONStringifyEnumerator); |
478 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 478 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
479 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); | 479 v8::Handle<v8::String> expected = v8_str("{\"regress\":\"crbug-161028\"}"); |
480 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); | 480 CHECK(CompileRun("JSON.stringify(obj)")->Equals(expected)); |
481 } | 481 } |
OLD | NEW |