| 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 6021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6032 bool fits_into_int32_t = (value & (1 << 31)) == 0; | 6032 bool fits_into_int32_t = (value & (1 << 31)) == 0; |
| 6033 if (fits_into_int32_t) { | 6033 if (fits_into_int32_t) { |
| 6034 return Integer::New(static_cast<int32_t>(value), isolate); | 6034 return Integer::New(static_cast<int32_t>(value), isolate); |
| 6035 } | 6035 } |
| 6036 ENTER_V8(internal_isolate); | 6036 ENTER_V8(internal_isolate); |
| 6037 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); | 6037 i::Handle<i::Object> result = internal_isolate->factory()->NewNumber(value); |
| 6038 return Utils::IntegerToLocal(result); | 6038 return Utils::IntegerToLocal(result); |
| 6039 } | 6039 } |
| 6040 | 6040 |
| 6041 | 6041 |
| 6042 #ifdef DEBUG |
| 6043 v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate) |
| 6044 : isolate_(isolate), |
| 6045 last_state_(i::EnterAllocationScope( |
| 6046 reinterpret_cast<i::Isolate*>(isolate), false)) { |
| 6047 } |
| 6048 |
| 6049 v8::AssertNoGCScope::~AssertNoGCScope() { |
| 6050 i::ExitAllocationScope(reinterpret_cast<i::Isolate*>(isolate_), last_state_); |
| 6051 } |
| 6052 #endif |
| 6053 |
| 6054 |
| 6042 void V8::IgnoreOutOfMemoryException() { | 6055 void V8::IgnoreOutOfMemoryException() { |
| 6043 EnterIsolateIfNeeded()->set_ignore_out_of_memory(true); | 6056 EnterIsolateIfNeeded()->set_ignore_out_of_memory(true); |
| 6044 } | 6057 } |
| 6045 | 6058 |
| 6046 | 6059 |
| 6047 bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) { | 6060 bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) { |
| 6048 i::Isolate* isolate = i::Isolate::Current(); | 6061 i::Isolate* isolate = i::Isolate::Current(); |
| 6049 EnsureInitializedForIsolate(isolate, "v8::V8::AddMessageListener()"); | 6062 EnsureInitializedForIsolate(isolate, "v8::V8::AddMessageListener()"); |
| 6050 ON_BAILOUT(isolate, "v8::V8::AddMessageListener()", return false); | 6063 ON_BAILOUT(isolate, "v8::V8::AddMessageListener()", return false); |
| 6051 ENTER_V8(isolate); | 6064 ENTER_V8(isolate); |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7635 | 7648 |
| 7636 v->VisitPointers(blocks_.first(), first_block_limit_); | 7649 v->VisitPointers(blocks_.first(), first_block_limit_); |
| 7637 | 7650 |
| 7638 for (int i = 1; i < blocks_.length(); i++) { | 7651 for (int i = 1; i < blocks_.length(); i++) { |
| 7639 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7652 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
| 7640 } | 7653 } |
| 7641 } | 7654 } |
| 7642 | 7655 |
| 7643 | 7656 |
| 7644 } } // namespace v8::internal | 7657 } } // namespace v8::internal |
| OLD | NEW |