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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 8339013: Use int instead of size_t, StrLength instead of strlen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 | « no previous file | no next file » | 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 832
833 v8::HandleScope handles; 833 v8::HandleScope handles;
834 v8::Persistent<v8::Context> context = v8::Context::New(); 834 v8::Persistent<v8::Context> context = v8::Context::New();
835 v8::Context::Scope context_scope(context); 835 v8::Context::Scope context_scope(context);
836 836
837 int marker; 837 int marker;
838 i::Isolate::Current()->stack_guard()->SetStackLimit( 838 i::Isolate::Current()->stack_guard()->SetStackLimit(
839 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024); 839 reinterpret_cast<uintptr_t>(&marker) - 128 * 1024);
840 840
841 for (int i = 0; source_data[i].outer_prefix; i++) { 841 for (int i = 0; source_data[i].outer_prefix; i++) {
842 size_t kPrefixLen = strlen(source_data[i].outer_prefix); 842 int kPrefixLen = i::StrLength(source_data[i].outer_prefix);
843 size_t kInnerLen = strlen(source_data[i].inner_source); 843 int kInnerLen = i::StrLength(source_data[i].inner_source);
844 size_t kSuffixLen = strlen(source_data[i].outer_suffix); 844 int kSuffixLen = i::StrLength(source_data[i].outer_suffix);
845 size_t kProgramSize = kPrefixLen + kInnerLen + kSuffixLen; 845 int kProgramSize = kPrefixLen + kInnerLen + kSuffixLen;
846 i::Vector<char> program = i::Vector<char>::New(kProgramSize + 1); 846 i::Vector<char> program = i::Vector<char>::New(kProgramSize + 1);
847 size_t length; 847 int length;
848 length = i::OS::SNPrintF(program, "%s%s%s", 848 length = i::OS::SNPrintF(program, "%s%s%s",
849 source_data[i].outer_prefix, 849 source_data[i].outer_prefix,
850 source_data[i].inner_source, 850 source_data[i].inner_source,
851 source_data[i].outer_suffix); 851 source_data[i].outer_suffix);
852 ASSERT(length == kProgramSize); 852 ASSERT(length == kProgramSize);
853 853
854 // Parse program source. 854 // Parse program source.
855 i::Handle<i::String> source( 855 i::Handle<i::String> source(
856 FACTORY->NewStringFromAscii(i::CStrVector(program.start()))); 856 FACTORY->NewStringFromAscii(i::CStrVector(program.start())));
857 i::Handle<i::Script> script = FACTORY->NewScript(source); 857 i::Handle<i::Script> script = FACTORY->NewScript(source);
(...skipping 11 matching lines...) Expand all
869 CHECK_EQ(scope->inner_scopes()->length(), 1); 869 CHECK_EQ(scope->inner_scopes()->length(), 1);
870 870
871 i::Scope* inner_scope = scope->inner_scopes()->at(0); 871 i::Scope* inner_scope = scope->inner_scopes()->at(0);
872 CHECK_EQ(inner_scope->type(), source_data[i].scope_type); 872 CHECK_EQ(inner_scope->type(), source_data[i].scope_type);
873 CHECK_EQ(inner_scope->start_position(), kPrefixLen); 873 CHECK_EQ(inner_scope->start_position(), kPrefixLen);
874 // The end position of a token is one position after the last 874 // The end position of a token is one position after the last
875 // character belonging to that token. 875 // character belonging to that token.
876 CHECK_EQ(inner_scope->end_position(), kPrefixLen + kInnerLen); 876 CHECK_EQ(inner_scope->end_position(), kPrefixLen + kInnerLen);
877 } 877 }
878 } 878 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698