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

Side by Side Diff: src/api.cc

Issue 8463013: Fix implicit conversions from bool to ParsingFlags. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | « no previous file | test/cctest/test-parsing.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value)); 1406 Utils::OpenHandle(this)->set_internal_field_count(i::Smi::FromInt(value));
1407 } 1407 }
1408 1408
1409 1409
1410 // --- S c r i p t D a t a --- 1410 // --- S c r i p t D a t a ---
1411 1411
1412 1412
1413 ScriptData* ScriptData::PreCompile(const char* input, int length) { 1413 ScriptData* ScriptData::PreCompile(const char* input, int length) {
1414 i::Utf8ToUC16CharacterStream stream( 1414 i::Utf8ToUC16CharacterStream stream(
1415 reinterpret_cast<const unsigned char*>(input), length); 1415 reinterpret_cast<const unsigned char*>(input), length);
1416 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping); 1416 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping
1417 ? i::kHarmonyScoping : i::kNoParsingFlags);
1417 } 1418 }
1418 1419
1419 1420
1420 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) { 1421 ScriptData* ScriptData::PreCompile(v8::Handle<String> source) {
1421 i::Handle<i::String> str = Utils::OpenHandle(*source); 1422 i::Handle<i::String> str = Utils::OpenHandle(*source);
1422 if (str->IsExternalTwoByteString()) { 1423 if (str->IsExternalTwoByteString()) {
1423 i::ExternalTwoByteStringUC16CharacterStream stream( 1424 i::ExternalTwoByteStringUC16CharacterStream stream(
1424 i::Handle<i::ExternalTwoByteString>::cast(str), 0, str->length()); 1425 i::Handle<i::ExternalTwoByteString>::cast(str), 0, str->length());
1425 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping); 1426 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping
1427 ? i::kHarmonyScoping : i::kNoParsingFlags);
1426 } else { 1428 } else {
1427 i::GenericStringUC16CharacterStream stream(str, 0, str->length()); 1429 i::GenericStringUC16CharacterStream stream(str, 0, str->length());
1428 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping); 1430 return i::ParserApi::PreParse(&stream, NULL, i::FLAG_harmony_scoping
1431 ? i::kHarmonyScoping : i::kNoParsingFlags);
1429 } 1432 }
1430 } 1433 }
1431 1434
1432 1435
1433 ScriptData* ScriptData::New(const char* data, int length) { 1436 ScriptData* ScriptData::New(const char* data, int length) {
1434 // Return an empty ScriptData if the length is obviously invalid. 1437 // Return an empty ScriptData if the length is obviously invalid.
1435 if (length % sizeof(unsigned) != 0) { 1438 if (length % sizeof(unsigned) != 0) {
1436 return new i::ScriptDataImpl(); 1439 return new i::ScriptDataImpl();
1437 } 1440 }
1438 1441
(...skipping 4678 matching lines...) Expand 10 before | Expand all | Expand 10 after
6117 6120
6118 6121
6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6122 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6120 HandleScopeImplementer* scope_implementer = 6123 HandleScopeImplementer* scope_implementer =
6121 reinterpret_cast<HandleScopeImplementer*>(storage); 6124 reinterpret_cast<HandleScopeImplementer*>(storage);
6122 scope_implementer->IterateThis(v); 6125 scope_implementer->IterateThis(v);
6123 return storage + ArchiveSpacePerThread(); 6126 return storage + ArchiveSpacePerThread();
6124 } 6127 }
6125 6128
6126 } } // namespace v8::internal 6129 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698