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

Side by Side Diff: src/api.cc

Issue 136413003: Deprecate ScriptData::PreCompile which takes const char*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: just removing Created 6 years, 11 months 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 | « include/v8.h ('k') | test/cctest/test-api.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 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 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 // function to do the setting. 1612 // function to do the setting.
1613 EnsureConstructor(isolate, this); 1613 EnsureConstructor(isolate, this);
1614 } 1614 }
1615 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); 1615 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value));
1616 } 1616 }
1617 1617
1618 1618
1619 // --- S c r i p t D a t a --- 1619 // --- S c r i p t D a t a ---
1620 1620
1621 1621
1622 ScriptData* ScriptData::PreCompile(v8::Isolate* isolate,
1623 const char* input,
1624 int length) {
1625 i::Utf8ToUtf16CharacterStream stream(
1626 reinterpret_cast<const unsigned char*>(input), length);
1627 return i::PreParserApi::PreParse(
1628 reinterpret_cast<i::Isolate*>(isolate), &stream);
1629 }
1630
1631
1632 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) { 1622 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) {
1633 i::Handle<i::String> str = Utils::OpenHandle(*source); 1623 i::Handle<i::String> str = Utils::OpenHandle(*source);
1634 i::Isolate* isolate = str->GetIsolate(); 1624 i::Isolate* isolate = str->GetIsolate();
1635 if (str->IsExternalTwoByteString()) { 1625 if (str->IsExternalTwoByteString()) {
1636 i::ExternalTwoByteStringUtf16CharacterStream stream( 1626 i::ExternalTwoByteStringUtf16CharacterStream stream(
1637 i::Handle<i::ExternalTwoByteString>::cast(str), 0, str->length()); 1627 i::Handle<i::ExternalTwoByteString>::cast(str), 0, str->length());
1638 return i::PreParserApi::PreParse(isolate, &stream); 1628 return i::PreParserApi::PreParse(isolate, &stream);
1639 } else { 1629 } else {
1640 i::GenericStringUtf16CharacterStream stream(str, 0, str->length()); 1630 i::GenericStringUtf16CharacterStream stream(str, 0, str->length());
1641 return i::PreParserApi::PreParse(isolate, &stream); 1631 return i::PreParserApi::PreParse(isolate, &stream);
(...skipping 5816 matching lines...) Expand 10 before | Expand all | Expand 10 after
7458 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7448 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7459 Address callback_address = 7449 Address callback_address =
7460 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7450 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7461 VMState<EXTERNAL> state(isolate); 7451 VMState<EXTERNAL> state(isolate);
7462 ExternalCallbackScope call_scope(isolate, callback_address); 7452 ExternalCallbackScope call_scope(isolate, callback_address);
7463 callback(info); 7453 callback(info);
7464 } 7454 }
7465 7455
7466 7456
7467 } } // namespace v8::internal 7457 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698