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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 uint8_t* data) { | 1080 uint8_t* data) { |
1081 size_t byte_length = | 1081 size_t byte_length = |
1082 Local<ArrayBuffer>::New(isolate, *array_buffer)->ByteLength(); | 1082 Local<ArrayBuffer>::New(isolate, *array_buffer)->ByteLength(); |
1083 isolate->AdjustAmountOfExternalAllocatedMemory( | 1083 isolate->AdjustAmountOfExternalAllocatedMemory( |
1084 -static_cast<intptr_t>(byte_length)); | 1084 -static_cast<intptr_t>(byte_length)); |
1085 | 1085 |
1086 delete[] data; | 1086 delete[] data; |
1087 array_buffer->Dispose(); | 1087 array_buffer->Dispose(); |
1088 } | 1088 } |
1089 | 1089 |
| 1090 |
1090 void Shell::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args) { | 1091 void Shell::ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args) { |
1091 ASSERT(sizeof(char) == sizeof(uint8_t)); // NOLINT | 1092 ASSERT(sizeof(char) == sizeof(uint8_t)); // NOLINT |
1092 String::Utf8Value filename(args[0]); | 1093 String::Utf8Value filename(args[0]); |
1093 int length; | 1094 int length; |
1094 if (*filename == NULL) { | 1095 if (*filename == NULL) { |
1095 Throw("Error loading file"); | 1096 Throw("Error loading file"); |
1096 return; | 1097 return; |
1097 } | 1098 } |
1098 | 1099 |
1099 Isolate* isolate = args.GetIsolate(); | 1100 Isolate* isolate = args.GetIsolate(); |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 } | 1658 } |
1658 | 1659 |
1659 } // namespace v8 | 1660 } // namespace v8 |
1660 | 1661 |
1661 | 1662 |
1662 #ifndef GOOGLE3 | 1663 #ifndef GOOGLE3 |
1663 int main(int argc, char* argv[]) { | 1664 int main(int argc, char* argv[]) { |
1664 return v8::Shell::Main(argc, argv); | 1665 return v8::Shell::Main(argc, argv); |
1665 } | 1666 } |
1666 #endif | 1667 #endif |
OLD | NEW |